{"openapi":"3.1.0","info":{"title":"GET /api/v1/projects/profitability","version":"1.0.0","description":"Project profitability"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/projects/profitability":{"get":{"tags":["projects"],"summary":"Project profitability","description":"Revenue, expense, and net profit broken down by project.","operationId":"project_profitability_api_v1_projects_profitability_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period start (inclusive).","title":"Start Date"},"description":"Period start (inclusive)."},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Period end (inclusive).","title":"End Date"},"description":"Period end (inclusive)."},{"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/ProjectProfitabilityResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"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":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ProjectProfitabilityResponse":{"properties":{"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"type":"string","format":"date","title":"End Date"},"rows":{"items":{"$ref":"#/components/schemas/ProjectProfitabilityRow"},"type":"array","title":"Rows"},"totals":{"$ref":"#/components/schemas/ProjectProfitabilityTotals"}},"type":"object","required":["start_date","end_date","rows","totals"],"title":"ProjectProfitabilityResponse","description":"Profit & loss broken down by project for a date range."},"ProjectProfitabilityRow":{"properties":{"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project UUID, or null for the unassigned bucket."},"project_name":{"type":"string","title":"Project Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"revenue":{"type":"integer","title":"Revenue"},"expenses":{"type":"integer","title":"Expenses"},"net_income":{"type":"integer","title":"Net Income"}},"type":"object","required":["project_name","revenue","expenses","net_income"],"title":"ProjectProfitabilityRow","description":"One project's revenue / expense / net for the period (cents)."},"ProjectProfitabilityTotals":{"properties":{"revenue":{"type":"integer","title":"Revenue"},"expenses":{"type":"integer","title":"Expenses"},"net_income":{"type":"integer","title":"Net Income"}},"type":"object","required":["revenue","expenses","net_income"],"title":"ProjectProfitabilityTotals","description":"Period totals across all projects (cents)."},"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":[]}]}