{"openapi":"3.1.0","info":{"title":"DELETE /api/v1/dashboards/{dashboard_id}/widgets/{widget_id}","version":"1.0.0","description":"Remove a widget"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/dashboards/{dashboard_id}/widgets/{widget_id}":{"delete":{"tags":["dashboards"],"summary":"Remove a widget","description":"Remove one widget from the dashboard.","operationId":"remove_widget_api_v1_dashboards__dashboard_id__widgets__widget_id__delete","parameters":[{"name":"dashboard_id","in":"path","required":true,"schema":{"type":"string","title":"Dashboard Id"}},{"name":"widget_id","in":"path","required":true,"schema":{"type":"string","title":"Widget 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":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DashboardResponse_"}}}},"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":{"ChartWidget":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"layout":{"$ref":"#/components/schemas/WidgetLayout"},"source":{"anyOf":[{"$ref":"#/components/schemas/WidgetSource"},{"type":"null"}]},"snapshot":{"$ref":"#/components/schemas/WidgetSnapshot"},"last_refresh_error":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Last Refresh Error"},"last_refreshed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refreshed At"},"widget_type":{"type":"string","const":"chart","title":"Widget Type","default":"chart"}},"additionalProperties":false,"type":"object","required":["id","title","snapshot"],"title":"ChartWidget"},"DashboardResponse":{"properties":{"dashboard":{"$ref":"#/components/schemas/DashboardSpec"}},"additionalProperties":false,"type":"object","required":["dashboard"],"title":"DashboardResponse","description":"Returned from create/get/update/widget endpoints. Wraps the spec."},"DashboardSpec":{"properties":{"version":{"type":"integer","const":1,"title":"Version","default":1},"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"visibility":{"type":"string","enum":["private","assigned","business"],"title":"Visibility","default":"private"},"widgets":{"items":{"oneOf":[{"$ref":"#/components/schemas/ChartWidget"},{"$ref":"#/components/schemas/TableWidget"},{"$ref":"#/components/schemas/MetricWidget"},{"$ref":"#/components/schemas/TextWidget"}],"discriminator":{"propertyName":"widget_type","mapping":{"chart":"#/components/schemas/ChartWidget","metric":"#/components/schemas/MetricWidget","table":"#/components/schemas/TableWidget","text":"#/components/schemas/TextWidget"}}},"type":"array","maxItems":24,"title":"Widgets"},"assigned_user_ids":{"items":{"type":"string"},"type":"array","title":"Assigned User Ids"},"created_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_refreshed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refreshed At"}},"additionalProperties":false,"type":"object","required":["id","title","created_at"],"title":"DashboardSpec","description":"The full dashboard payload — exactly what the FE renderer consumes."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MetricWidget":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"layout":{"$ref":"#/components/schemas/WidgetLayout"},"source":{"anyOf":[{"$ref":"#/components/schemas/WidgetSource"},{"type":"null"}]},"snapshot":{"$ref":"#/components/schemas/WidgetSnapshot"},"last_refresh_error":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Last Refresh Error"},"last_refreshed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refreshed At"},"widget_type":{"type":"string","const":"metric","title":"Widget Type","default":"metric"}},"additionalProperties":false,"type":"object","required":["id","title","snapshot"],"title":"MetricWidget","description":"A single headline number (e.g. cash on hand, total AR)."},"SuccessEnvelope_DashboardResponse_":{"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/DashboardResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DashboardResponse]"},"TableWidget":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"layout":{"$ref":"#/components/schemas/WidgetLayout"},"source":{"anyOf":[{"$ref":"#/components/schemas/WidgetSource"},{"type":"null"}]},"snapshot":{"$ref":"#/components/schemas/WidgetSnapshot"},"last_refresh_error":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Last Refresh Error"},"last_refreshed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refreshed At"},"widget_type":{"type":"string","const":"table","title":"Widget Type","default":"table"}},"additionalProperties":false,"type":"object","required":["id","title","snapshot"],"title":"TableWidget"},"TextWidget":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"layout":{"$ref":"#/components/schemas/WidgetLayout"},"source":{"anyOf":[{"$ref":"#/components/schemas/WidgetSource"},{"type":"null"}]},"snapshot":{"anyOf":[{"$ref":"#/components/schemas/WidgetSnapshot"},{"type":"null"}]},"last_refresh_error":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Last Refresh Error"},"last_refreshed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refreshed At"},"widget_type":{"type":"string","const":"text","title":"Widget Type","default":"text"},"body":{"type":"string","maxLength":8000,"title":"Body","default":""}},"additionalProperties":false,"type":"object","required":["id","title"],"title":"TextWidget","description":"Free-form markdown note; has no data snapshot requirement."},"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"},"WidgetLayout":{"properties":{"x":{"type":"integer","maximum":11.0,"minimum":0.0,"title":"X","default":0},"y":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Y","default":0},"w":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"W","default":6},"h":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"H","default":4}},"additionalProperties":false,"type":"object","title":"WidgetLayout","description":"Position on a 12-column grid."},"WidgetSnapshot":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data"},"ui_hint":{"type":"string","maxLength":60,"minLength":1,"title":"Ui Hint"},"captured_at":{"type":"string","format":"date-time","title":"Captured At"}},"type":"object","required":["data","ui_hint","captured_at"],"title":"WidgetSnapshot","description":"The captured chat payload the widget renders from.\n\n``data`` is intentionally open-shaped (chat payloads vary per tool), so no\n``extra=\"forbid\"`` here — only the size guard applies."},"WidgetSource":{"properties":{"tool_name":{"type":"string","maxLength":120,"minLength":1,"title":"Tool Name"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"refreshable":{"type":"boolean","title":"Refreshable","default":true}},"additionalProperties":false,"type":"object","required":["tool_name"],"title":"WidgetSource","description":"The READ tool invocation that can re-produce this widget's data."}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}