{"components":{"parameters":{"IdempotencyKey":{"description":"UUID V4 to prevent duplicate mutation execution (Double Submission).","in":"header","name":"Idempotency-Key","required":true,"schema":{"format":"uuid","type":"string"}}},"schemas":{"AdminOverrideInput":{"properties":{"entity_id":{"type":"string"},"entity_type":{"default":"citizentusthub_ITEM","type":"string"},"expected_version":{"type":"integer"},"reason":{"type":"string"},"status":{"enum":["PUBLISHED","SUSPENDED","COMPLETED","CANCELLED"],"type":"string"}},"required":["entity_id","status","expected_version"],"type":"object"},"CitizenReportInput":{"properties":{"category":{"enum":["SCAM","TERRORISM","VIOLATION","DUPLICATE"],"type":"string"},"description":{"minLength":10,"type":"string"},"expected_version":{"type":"integer"}},"required":["category","description","expected_version"],"type":"object"},"DisputeResolveInput":{"properties":{"decision":{"enum":["REFUND_LESSEE","FORFEIT_DEPOSIT","DISMISS"],"type":"string"},"expected_version":{"type":"integer"},"reason":{"minLength":10,"type":"string"}},"required":["decision","reason","expected_version"],"type":"object"},"ErrorResponse":{"properties":{"details":{"items":{"type":"object"},"type":"array"},"message":{"type":"string"},"type":{"type":"string"}},"type":"object"},"InitiativeCreateInput":{"properties":{"deposit_required":{"default":0.0,"type":"number"},"description":{"maxLength":255,"minLength":5,"type":"string"},"image_base64":{"type":"string"},"initiative_type":{"enum":["RENTAL","DONATION","TRAINING","SALE","SERVICE","COMMUNITY_REMBUK","GREEN_INITIATIVE","CAMPAIGN"],"type":"string"},"long_description":{"type":"string"},"rental_fee_per_day":{"default":0.0,"type":"number"},"terms_condition":{"type":"string"},"visibility":{"default":"PUBLIC","type":"string"}},"required":["initiative_type","description"],"type":"object"},"InitiativeERPUpdateInput":{"properties":{"expected_version":{"type":"integer"},"milestones":{"items":{"$ref":"#/components/schemas/MilestoneInputItem"},"type":"array"},"resources":{"items":{"$ref":"#/components/schemas/ResourceInputItem"},"type":"array"}},"required":["expected_version"],"type":"object"},"MilestoneInputItem":{"properties":{"end_date":{"format":"date-time","type":"string"},"name":{"minLength":3,"type":"string"},"start_date":{"format":"date-time","type":"string"},"status":{"default":"PENDING","type":"string"}},"required":["name","start_date","end_date"],"type":"object"},"ResourceInputItem":{"properties":{"name":{"minLength":2,"type":"string"},"price":{"default":0.0,"minimum":0.0,"type":"number"},"qty":{"default":1,"minimum":1,"type":"integer"}},"required":["name"],"type":"object"},"StaffDelegateInput":{"properties":{"assigned_tasks":{"items":{"type":"string"},"type":"array"},"expected_version":{"type":"integer"},"role":{"enum":["TEAM_OWNER","TEAM_LEADER","COORDINATOR","MEMBER","OBSERVER","AUDITOR","PROJECT_MANAGER"],"type":"string"},"user_id":{"type":"integer"}},"required":["user_id","role","expected_version"],"type":"object"}},"securitySchemes":{"BearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"},"CookieAuth":{"in":"cookie","name":"tatanota_session","type":"apiKey"}}},"info":{"contact":{"email":"tatanotadotcom@gmail.com","name":"TataNota Architecture Team"},"description":"Backend-For-Frontend (BFF) API Contract for citizentusthub Citizen Hub, Micro-ERP, Dispute Resolution, and Knowledge Base (RAG) operations. Hardened with Zero-Trust Architecture, Idempotency, and Fail-Closed principles.","title":"TataNota citizentusthub & Governance BFF API","version":"1.0.0"},"openapi":"1.0.0","paths":{"/v1/citizentusthub/disputes/admin/override":{"post":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOverrideInput"}}}},"responses":{"200":{"description":"Takedown Executed"}},"summary":"Absolute Admin Intervention (Initiative Takedown)","tags":["Governance - Moderation"]}},"/v1/citizentusthub/disputes/moderation/reports":{"get":{"responses":{"200":{"description":"List of flagged initiatives"}},"summary":"Fetch aggregated citizen reports for Operator Dashboard","tags":["Governance - Moderation"]}},"/v1/citizentusthub/disputes/{tx_id}/resolve":{"post":{"parameters":[{"in":"path","name":"tx_id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeResolveInput"}}}},"responses":{"200":{"description":"Dispute Resolved"}},"summary":"Execute dispute mediation decision","tags":["Governance - Disputes"]}},"/v1/citizentusthub/items":{"get":{"parameters":[{"in":"query","name":"type","schema":{"type":"string"}},{"in":"query","name":"page","schema":{"default":1,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer"}}],"responses":{"200":{"description":"Successfully loaded catalog."}},"summary":"Retrieve a list of public or tenant-owned initiatives","tags":["citizentusthub - Catalog"]},"post":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiativeCreateInput"}}}},"responses":{"200":{"description":"Success or Processing (202)"},"409":{"description":"Idempotency Conflict"},"422":{"description":"Validation Error"}},"summary":"Create a new initiative draft","tags":["citizentusthub - Catalog"]}},"/v1/citizentusthub/items/{item_id}/erp":{"patch":{"parameters":[{"in":"path","name":"item_id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitiativeERPUpdateInput"}}}},"responses":{"200":{"description":"ERP Updated"},"409":{"description":"OCC Conflict"}},"summary":"Update Micro-ERP data (Schedule & Budget)","tags":["citizentusthub - Operations"]}},"/v1/citizentusthub/items/{item_id}/report":{"post":{"parameters":[{"in":"path","name":"item_id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CitizenReportInput"}}}},"responses":{"200":{"description":"Report accepted"},"409":{"description":"OCC Conflict"}},"summary":"Report an initiative (Scam/Takedown)","tags":["citizentusthub - Moderation"]}},"/v1/citizentusthub/storage/upload":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"}},"type":"object"}}}},"responses":{"201":{"description":"File successfully uploaded and hashed (WORM)"}},"summary":"Upload physical document (Multipart FormData)","tags":["citizentusthub - Storage"]}},"/v1/knowledge/rebuild":{"post":{"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"Rebuild task scheduled in the background"}},"summary":"Rebuild Knowledge Base Vector Index","tags":["Knowledge Base (RAG)"]}},"/v1/staff/initiatives/{item_id}/delegate":{"post":{"parameters":[{"in":"path","name":"item_id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffDelegateInput"}}}},"responses":{"200":{"description":"Staff assigned"}},"summary":"Delegate staff to an initiative (WORM Tracked)","tags":["Staff Management"]}},"/v1/stream/analytics":{"get":{"description":"Provides real-time updates (Time-Bounded 30s) with Load Shedding protection.","responses":{"200":{"description":"Streaming connected (Content-Type: text/event-stream)"},"503":{"description":"Load Shedding active (Retry-After header provided)"}},"summary":"Server-Sent Events (SSE) Real-Time Data Stream","tags":["Streaming"]}}},"security":[{"BearerAuth":[]},{"CookieAuth":[]}],"servers":[{"description":"Production Server","url":"https://api.tatanota.com"},{"description":"Staging / QA Server","url":"https://staging-api.tatanota.com"},{"description":"Local Development","url":"http://localhost:5000"}]}
