{"openapi":"3.1.0","info":{"title":"GET /api/v1/contracts/summary","version":"1.0.0","description":"Portfolio summary (dashboard KPIs)"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/contracts/summary":{"get":{"tags":["contracts"],"summary":"Portfolio summary (dashboard KPIs)","description":"Business-wide contract KPIs aggregated in SQL across ALL contracts (not a capped page): total value, billed, recognized, deferred, and counts by status.","operationId":"contract_portfolio_summary_api_v1_contracts_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ContractPortfolioSummary_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ContractPortfolioSummary":{"properties":{"business_id":{"type":"string","title":"Business Id"},"total_contract_value_cents":{"type":"integer","title":"Total Contract Value Cents","default":0},"total_billed_cents":{"type":"integer","title":"Total Billed Cents","default":0},"total_recognized_cents":{"type":"integer","title":"Total Recognized Cents","default":0},"total_deferred_cents":{"type":"integer","title":"Total Deferred Cents","default":0},"contract_count":{"type":"integer","title":"Contract Count","default":0},"active_contract_count":{"type":"integer","title":"Active Contract Count","default":0},"counts_by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Status"}},"type":"object","required":["business_id"],"title":"ContractPortfolioSummary","description":"Business-wide aggregate KPIs across ALL contracts (dashboard header).\n\nAggregated in SQL (never a Python loop over a capped page), so the figures\nreflect the whole portfolio rather than a single page of contracts."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_ContractPortfolioSummary_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ContractPortfolioSummary"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ContractPortfolioSummary]"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}