{"openapi":"3.1.0","info":{"title":"Kavra Siegel","description":"Qualified eIDAS timestamp service for Kavra products and AI-agents.","version":"0.2.0"},"paths":{"/health/":{"get":{"tags":["health"],"summary":"Health","operationId":"health_health__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Health Health  Get"}}}}}}},"/api/v1/internal/v1/stamp":{"post":{"tags":["internal"],"summary":"Stamp","operationId":"stamp_api_v1_internal_v1_stamp_post","parameters":[{"name":"x-kavra-service-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Kavra-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/internal/v1/verify":{"post":{"tags":["internal"],"summary":"Verify","operationId":"verify_api_v1_internal_v1_verify_post","parameters":[{"name":"x-kavra-service-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Kavra-Service-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/internal/v1/stamps":{"get":{"tags":["internal"],"summary":"List Stamps","description":"List recent stamps for the calling product.","operationId":"list_stamps_api_v1_internal_v1_stamps_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"x-kavra-service-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Kavra-Service-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/internal/stats/daily":{"get":{"tags":["internal"],"summary":"Daily Stats","description":"Daily stamp metrics for cutover observability.\n\nReturns rows from siegel_metrics_daily for the last N days,\ngrouped by provider, is_qualified, caller_kind.","operationId":"daily_stats_api_v1_internal_stats_daily_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Days"}},{"name":"x-kavra-service-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Kavra-Service-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"},"title":"Response Daily Stats Api V1 Internal Stats Daily Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agent/pricing":{"get":{"tags":["agent"],"summary":"Agent Pricing","description":"Public pricing endpoint — no auth required, cacheable.","operationId":"agent_pricing_api_v1_agent_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Agent Pricing Api V1 Agent Pricing Get"}}}}}}},"/api/v1/agent/v1/stamp/basic":{"post":{"tags":["agent"],"summary":"Stamp Basic","operationId":"stamp_basic_api_v1_agent_v1_stamp_basic_post","parameters":[{"name":"x-payment-transaction","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Payment-Transaction"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agent/v1/stamp/plus":{"post":{"tags":["agent"],"summary":"Stamp Plus","operationId":"stamp_plus_api_v1_agent_v1_stamp_plus_post","parameters":[{"name":"x-payment-transaction","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Payment-Transaction"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agent/v1/stamp/sealed":{"post":{"tags":["agent"],"summary":"Stamp Sealed","operationId":"stamp_sealed_api_v1_agent_v1_stamp_sealed_post","parameters":[{"name":"x-payment-transaction","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Payment-Transaction"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StampToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/verify/v1/token/{token_id}":{"get":{"tags":["verify"],"summary":"Verify By Id","operationId":"verify_by_id_api_v1_verify_v1_token__token_id__get","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/verify/v1/raw":{"post":{"tags":["verify"],"summary":"Verify Raw","operationId":"verify_raw_api_v1_verify_v1_raw_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp":{"post":{"tags":["mcp"],"summary":"Mcp Endpoint","description":"MCP JSON-RPC 2.0 endpoint.\n\nAuth: X-Kavra-Service-Token header (same as /api/v1/internal).","operationId":"mcp_endpoint_mcp_post","parameters":[{"name":"x-kavra-service-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Kavra-Service-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/status":{"get":{"tags":["status"],"summary":"Status Page","description":"Public status page — no auth required. Rate-limited to 30/min.","operationId":"status_page_status_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/v1/status":{"get":{"tags":["status"],"summary":"Public Stats","description":"Public stats endpoint — aggregated, sanitized metrics. No auth required.\n\nReturns service status, TSP info, 24h + lifetime counters.\nNever leaks token IDs, caller identities, wallet addresses, or internal paths.","operationId":"public_stats_api_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/workflow/start":{"post":{"tags":["workflow"],"summary":"Start Workflow","description":"Create a new workflow. No auth required for MVP (x402 pricing is Phase C).","operationId":"start_workflow_api_v1_workflow_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStartRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/{workflow_id}/stamp":{"post":{"tags":["workflow"],"summary":"Stamp Output","description":"Stamp a workflow output. Auth: Workflow token.","operationId":"stamp_output_api_v1_workflow__workflow_id__stamp_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStampRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowStampResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/{workflow_id}/complete":{"post":{"tags":["workflow"],"summary":"Complete Workflow","description":"Complete a workflow. Auth: Workflow token.","operationId":"complete_workflow_api_v1_workflow__workflow_id__complete_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCompleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/{workflow_id}/redact-pii":{"post":{"tags":["workflow"],"summary":"Redact Pii","description":"DSGVO: redact PII from workflow. Auth: Workflow token.","operationId":"redact_pii_api_v1_workflow__workflow_id__redact_pii_post","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Redact Pii Api V1 Workflow  Workflow Id  Redact Pii Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflow/{workflow_id}/verify-user":{"get":{"tags":["workflow-verify"],"summary":"Verify User Otp","description":"OTP verification callback — validates challenge token, activates workflow.","operationId":"verify_user_otp_api_v1_workflow__workflow_id__verify_user_get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}},{"name":"challenge","in":"query","required":false,"schema":{"type":"string","default":"","title":"Challenge"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workflow/{workflow_id}":{"get":{"tags":["workflow-verify"],"summary":"Workflow Verify Page","description":"Public workflow verify page — shows workflow data + outputs list.","operationId":"workflow_verify_page_workflow__workflow_id__get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"StampListItem":{"properties":{"token_id":{"type":"string","format":"uuid","title":"Token Id"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"tier":{"$ref":"#/components/schemas/StampTier"},"content_sha256":{"type":"string","title":"Content Sha256"},"is_qualified":{"type":"boolean","title":"Is Qualified"}},"type":"object","required":["token_id","issued_at","tier","content_sha256","is_qualified"],"title":"StampListItem"},"StampListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StampListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"StampListResponse"},"StampRequest":{"properties":{"hash":{"anyOf":[{"type":"string","maxLength":64,"minLength":64},{"type":"null"}],"title":"Hash","description":"SHA-256 hex of the content. Lowercase, 64 chars."},"content_b64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content B64","description":"Base64-encoded raw content (only allowed in tier 'sealed')."},"tier":{"allOf":[{"$ref":"#/components/schemas/StampTier"}],"default":"basic"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional caller metadata, persisted but not signed."}},"type":"object","title":"StampRequest","description":"Stamp a hash OR content (one of). For Phase 1 we accept both for flexibility."},"StampTier":{"type":"string","enum":["basic","plus","sealed"],"title":"StampTier"},"StampToken":{"properties":{"token_id":{"type":"string","format":"uuid","title":"Token Id"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"content_sha256":{"type":"string","title":"Content Sha256"},"token":{"type":"string","title":"Token","description":"Opaque token body — RFC-3161 base64 in real TSPs"},"tier":{"$ref":"#/components/schemas/StampTier"},"tsp_provider":{"type":"string","title":"Tsp Provider"},"is_qualified":{"type":"boolean","title":"Is Qualified","description":"True for real qualified TSPs, False for the mock adapter."},"verify_url":{"type":"string","title":"Verify Url"},"sealed_storage_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sealed Storage Url"}},"type":"object","required":["token_id","issued_at","content_sha256","token","tier","tsp_provider","is_qualified","verify_url"],"title":"StampToken"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerificationResult":{"properties":{"valid":{"type":"boolean","title":"Valid"},"token_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Token Id"},"issued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Issued At"},"content_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Sha256"},"tsp_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tsp Provider"},"is_qualified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Qualified"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Falls 'valid' False: lokale Begründung."}},"type":"object","required":["valid"],"title":"VerificationResult"},"VerifyRequest":{"properties":{"token":{"type":"string","title":"Token","description":"The opaque token returned by /stamp"}},"type":"object","required":["token"],"title":"VerifyRequest"},"WorkflowCompleteResponse":{"properties":{"workflow_id":{"type":"string","format":"uuid","title":"Workflow Id"},"status":{"type":"string","title":"Status"},"output_count":{"type":"integer","title":"Output Count"},"verify_url":{"type":"string","title":"Verify Url"},"completed_at":{"type":"string","format":"date-time","title":"Completed At"}},"type":"object","required":["workflow_id","status","output_count","verify_url","completed_at"],"title":"WorkflowCompleteResponse"},"WorkflowStampRequest":{"properties":{"output_hash":{"type":"string","maxLength":64,"minLength":64,"title":"Output Hash","description":"SHA-256 des Outputs"},"output_type":{"type":"string","title":"Output Type","description":"image | text | audio | video | code | layout"},"output_metadata":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Output Metadata","description":"Optional, max 4 KB"}},"type":"object","required":["output_hash","output_type"],"title":"WorkflowStampRequest"},"WorkflowStampResponse":{"properties":{"output_id":{"type":"string","format":"uuid","title":"Output Id"},"sequence_number":{"type":"integer","title":"Sequence Number"},"stamp_token_id":{"type":"string","format":"uuid","title":"Stamp Token Id"},"verify_url":{"type":"string","title":"Verify Url"},"workflow_anchor_url":{"type":"string","title":"Workflow Anchor Url"}},"type":"object","required":["output_id","sequence_number","stamp_token_id","verify_url","workflow_anchor_url"],"title":"WorkflowStampResponse"},"WorkflowStartRequest":{"properties":{"user_email":{"type":"string","title":"User Email","description":"Email des Auftraggebers (OTP-Verifizierung)"},"agent_id":{"type":"string","title":"Agent Id","description":"Agent-Identifier (frei wählbar)"},"briefing_hash":{"type":"string","maxLength":64,"minLength":64,"title":"Briefing Hash","description":"SHA-256 des Briefings"},"briefing_metadata":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Briefing Metadata","description":"Optional, max 4 KB"},"tier":{"type":"string","title":"Tier","description":"standard | verified | qualified","default":"standard"}},"type":"object","required":["user_email","agent_id","briefing_hash"],"title":"WorkflowStartRequest"},"WorkflowStartResponse":{"properties":{"workflow_id":{"type":"string","format":"uuid","title":"Workflow Id"},"workflow_token":{"type":"string","title":"Workflow Token"},"otp_sent_to":{"type":"string","title":"Otp Sent To"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"status":{"type":"string","title":"Status"}},"type":"object","required":["workflow_id","workflow_token","otp_sent_to","expires_at","status"],"title":"WorkflowStartResponse"}}}}