{"openapi":"3.1.0","info":{"title":"POST /api/v1/businesses/{business_id}/cfo-portal/cash-forecast/versions/{version_id}/apply","version":"1.0.0","description":"Re-apply a saved version's config to the live forecast"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/versions/{version_id}/apply":{"post":{"tags":["cfo-portal"],"summary":"Re-apply a saved version's config to the live forecast","description":"Load a saved version into the user's working scope.\n\nPushes the version's budget exclusion list to business settings\nand replays its overrides into the working scope so the live\nforecast recomputes against the saved configuration. The caller\nshould invalidate the cash-forecast query and use ``budget_id``\nfrom the response to sync any local budget-selector state.","operationId":"cfo_portal_apply_version_api_v1_businesses__business_id__cfo_portal_cash_forecast_versions__version_id__apply_post","parameters":[{"name":"business_id","in":"path","required":true,"schema":{"type":"string","title":"Business Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version 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"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashForecastVersionApplyResponse"}}}},"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":{"CashForecastVersionApplyResponse":{"properties":{"version_id":{"type":"string","title":"Version Id"},"budget_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget Id"},"excluded_budget_ledger_ids":{"items":{"type":"string"},"type":"array","title":"Excluded Budget Ledger Ids"},"applied_override_count":{"type":"integer","title":"Applied Override Count"}},"type":"object","required":["version_id","applied_override_count"],"title":"CashForecastVersionApplyResponse","description":"Response from applying a saved version to the live view.\n\nThe ``budget_id`` is returned explicitly so the frontend can sync\nits local \"selected budget\" state (it is per-request via query\nparameter, not stored on the business)."},"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":[]}]}