{"openapi":"3.1.0","info":{"title":"POST /api/v1/dashboards/{dashboard_id}/versions","version":"1.0.0","description":"Save a dashboard version"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/dashboards/{dashboard_id}/versions":{"post":{"tags":["dashboards"],"summary":"Save a dashboard version","description":"Capture the dashboard's current title, description, visibility and widgets as a new numbered version. This is an explicit user action — editing a dashboard or refreshing its widgets does NOT create a version. At most 25 versions are retained per dashboard; saving past that prunes the oldest.","operationId":"save_dashboard_version_api_v1_dashboards__dashboard_id__versions_post","parameters":[{"name":"dashboard_id","in":"path","required":true,"schema":{"type":"string","title":"Dashboard 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/SaveVersionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DashboardVersionDetail_"}}}},"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":{"DashboardVersionDetail":{"properties":{"id":{"type":"string","title":"Id"},"dashboard_id":{"type":"string","title":"Dashboard Id"},"version_number":{"type":"integer","title":"Version Number"},"change_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Summary"},"widget_count":{"type":"integer","title":"Widget Count","default":0},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"is_current":{"type":"boolean","title":"Is Current","default":false},"spec":{"additionalProperties":true,"type":"object","title":"Spec"}},"additionalProperties":false,"type":"object","required":["id","dashboard_id","version_number","created_at"],"title":"DashboardVersionDetail","description":"A single version including its stored spec (for preview/diff)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SaveVersionRequest":{"properties":{"change_summary":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Change Summary"}},"additionalProperties":false,"type":"object","title":"SaveVersionRequest","description":"Body for ``POST /dashboards/{dashboard_id}/versions``.\n\nVersioning is an explicit user action, never a side effect of a PATCH or\na widget refresh — so this request carries only the human's label for the\nsnapshot; the spec itself is read from the live dashboard server-side."},"SuccessEnvelope_DashboardVersionDetail_":{"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/DashboardVersionDetail"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DashboardVersionDetail]"},"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":[]}]}