{"openapi":"3.1.0","info":{"title":"PUT /api/v1/businesses/{business_id}/cfo-portal/cash-forecast/overrides","version":"1.0.0","description":"Replace all cash forecast overrides in a scope"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/overrides":{"put":{"tags":["cfo-portal"],"summary":"Replace all cash forecast overrides in a scope","description":"Atomically replace every override row in the matching scope.\n\n**Request Body:**\n- ``version_id``: Optional. If null, replaces the working override\n  set; otherwise replaces overrides pinned to that saved version.\n- ``overrides``: List of cells to override (week_number / column /\n  amount_cents).\n\n**Effect:** All existing overrides in the scope are deleted, then\nthe provided rows are inserted. Use the empty list to clear the\nscope without deleting the URL.","operationId":"cfo_portal_upsert_overrides_api_v1_businesses__business_id__cfo_portal_cash_forecast_overrides_put","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastOverridesUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastOverrideList"}}}},"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"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CashForecastOverride":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"week_number":{"type":"integer","title":"Week Number"},"column":{"type":"string","enum":["ar_in","ap_out","inventory","debt","budget_rev","budget_exp","one_time"],"title":"Column"},"override_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Override Amount Cents"},"source":{"type":"string","enum":["user","ai"],"title":"Source","default":"user"},"ai_scenario_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Scenario Label"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","business_id","week_number","column","created_at","updated_at"],"title":"CashForecastOverride","description":"Stored override row."},"CashForecastOverrideInput":{"properties":{"week_number":{"type":"integer","maximum":104.0,"minimum":0.0,"title":"Week Number"},"column":{"type":"string","enum":["ar_in","ap_out","inventory","debt","budget_rev","budget_exp","one_time"],"title":"Column"},"amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Cents"},"source":{"type":"string","enum":["user","ai"],"title":"Source","default":"user"},"ai_scenario_label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Ai Scenario Label"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"}},"type":"object","required":["week_number","column"],"title":"CashForecastOverrideInput","description":"One cell-level override applied to a forecast week.\n\n``week_number = 0`` targets the Overdue row, ``1..weeks`` targets a\nweekly cell. ``column`` matches the forecast column names\n(``ar_in``, ``ap_out``, ``inventory``, ``debt``, ``budget_rev``,\n``budget_exp``, ``one_time``). ``amount_cents`` is treated as the\nliteral value to use; ``None`` means \"force this cell to zero\"."},"CashForecastOverrideList":{"properties":{"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"items":{"items":{"$ref":"#/components/schemas/CashForecastOverride"},"type":"array","title":"Items"}},"type":"object","title":"CashForecastOverrideList"},"CashForecastOverridesUpsert":{"properties":{"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id"},"overrides":{"items":{"$ref":"#/components/schemas/CashForecastOverrideInput"},"type":"array","title":"Overrides"}},"type":"object","title":"CashForecastOverridesUpsert","description":"Bulk upsert for the user's working override set.\n\nThe service replaces all overrides for the matching\n``(business_id, version_id)`` scope with the rows provided here, so\nthe frontend can save the entire override map in one round-trip."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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":[]}]}