{"openapi":"3.1.0","info":{"title":"AI Reporting — DayZero API","version":"1.0.0","description":"AI Reporting endpoints."},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/ai-reporting/decks":{"get":{"tags":["ai-reporting"],"summary":"List generated decks","description":"Cursor-paginated list of AI-generated decks for the business.","operationId":"list_decks","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination","title":"Cursor"},"description":"Cursor for pagination"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Pagination limit","title":"Limit"},"description":"Pagination limit"},{"name":"direction","in":"query","required":false,"schema":{"type":"string","description":"Pagination direction: 'next' or 'prev'","default":"next","title":"Direction"},"description":"Pagination direction: 'next' or 'prev'"},{"name":"include_total_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include total count (expensive - avoid if possible)","default":false,"title":"Include Total Count"},"description":"Whether to include total count (expensive - avoid if possible)"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.","title":"Sort By"},"description":"Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None."},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","description":"Sort direction: true for descending (newest/largest first), false for ascending","default":true,"title":"Descending"},"description":"Sort direction: true for descending (newest/largest first), false for ascending"},{"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_CursorPaginatedResponse_DeckListItem__"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"list_decks_api_v1_ai_reporting_decks_get"},"post":{"tags":["ai-reporting"],"summary":"Generate a new AI deck","description":"Build a new deck from live data + AI commentary and persist it. Returns the full DeckSpec ready to render.","operationId":"generate_deck","parameters":[{"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/GenerateDeckRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GenerateDeckResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"generate_deck_api_v1_ai_reporting_decks_post"}},"/api/v1/ai-reporting/decks/{deck_id}":{"get":{"tags":["ai-reporting"],"summary":"Get a deck","description":"Fetch the full DeckSpec for a single deck.","operationId":"get_deck","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck 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_DeckSpec_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"get_deck_api_v1_ai_reporting_decks__deck_id__get"},"delete":{"tags":["ai-reporting"],"summary":"Delete a deck","description":"Soft-delete a deck. Existing share links continue to 404.","operationId":"delete_deck","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck 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/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"delete_deck_api_v1_ai_reporting_decks__deck_id__delete"}},"/api/v1/ai-reporting/decks/{deck_id}/refresh":{"post":{"tags":["ai-reporting"],"summary":"Refresh a deck with live data","description":"Re-pull live CFO-portal data into every data-bound slide of an existing deck. Titles, ordering, hidden flags, and commentary are preserved (pass regenerate_commentary=true to refresh the AI commentary too). The reporting period stays fixed — a refresh means 'same window, current numbers'.","operationId":"refresh_deck","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck 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":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RefreshDeckRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_GenerateDeckResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"refresh_deck_api_v1_ai_reporting_decks__deck_id__refresh_post"}},"/api/v1/ai-reporting/decks/{deck_id}/slides/{slide_id}":{"patch":{"tags":["ai-reporting"],"summary":"Edit a slide","description":"Patch the slide title, commentary (headline/claims/recommendation) or hidden flag. Use this for the 'edit commentary' button.","operationId":"update_slide","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"slide_id","in":"path","required":true,"schema":{"type":"string","title":"Slide 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/UpdateSlideRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"update_slide_api_v1_ai_reporting_decks__deck_id__slides__slide_id__patch"}},"/api/v1/ai-reporting/decks/{deck_id}/slides":{"post":{"tags":["ai-reporting"],"summary":"Add a slide to a deck","description":"Insert a new slide. Data-bound types are populated from live CFO portal data (with AI commentary); 'custom' slides use the supplied markdown. Optional 0-based position, defaults to the end.","operationId":"add_slide","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck 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/AddSlideRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"add_slide_api_v1_ai_reporting_decks__deck_id__slides_post"}},"/api/v1/ai-reporting/decks/{deck_id}/slides/{slide_id}/duplicate":{"post":{"tags":["ai-reporting"],"summary":"Duplicate a slide","description":"Copy a slide (new id, same content, title suffixed with '(copy)') directly after the original. No body required.","operationId":"duplicate_slide","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"slide_id","in":"path","required":true,"schema":{"type":"string","title":"Slide 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/SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"duplicate_slide_api_v1_ai_reporting_decks__deck_id__slides__slide_id__duplicate_post"}},"/api/v1/ai-reporting/decks/{deck_id}/slides/{slide_id}/refresh":{"post":{"tags":["ai-reporting"],"summary":"Refresh a single slide with live data","description":"Re-pull live data for one data-bound slide. 400s for slide types that carry no live data (cover, asks, custom). Pass regenerate_commentary=true to refresh its AI commentary too.","operationId":"refresh_slide","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"slide_id","in":"path","required":true,"schema":{"type":"string","title":"Slide 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":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RefreshDeckRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"refresh_slide_api_v1_ai_reporting_decks__deck_id__slides__slide_id__refresh_post"}},"/api/v1/ai-reporting/decks/{deck_id}/slides/{slide_id}/toggle-hidden":{"post":{"tags":["ai-reporting"],"summary":"Toggle slide visibility","description":"Flip the ``hidden`` flag on a single slide. No body required.","operationId":"toggle_slide_hidden","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"slide_id","in":"path","required":true,"schema":{"type":"string","title":"Slide 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/SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"toggle_slide_hidden_api_v1_ai_reporting_decks__deck_id__slides__slide_id__toggle_hidden_post"}},"/api/v1/ai-reporting/decks/{deck_id}/slides/reorder":{"post":{"tags":["ai-reporting"],"summary":"Reorder slides","description":"Set a new slide order via a list of slide_ids.","operationId":"reorder_slides","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck 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/ReorderSlidesRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_DeckSpec_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"reorder_slides_api_v1_ai_reporting_decks__deck_id__slides_reorder_post"}},"/api/v1/ai-reporting/decks/{deck_id}/export":{"post":{"tags":["ai-reporting"],"summary":"Export a deck","description":"Export an already-generated deck to PPTX or PDF. The default path assembles the file natively from the stored DeckSpec (python-pptx / WeasyPrint) — searchable text, real tables, server-rendered charts. Clients may still upload rendered slide PNGs as multipart parts to force the legacy screenshot pipeline. Returns the file as a streaming response with a content-disposition header.","operationId":"export_deck","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(pptx|pdf)$","default":"pptx","title":"Format"}},{"name":"commentary","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commentary"}},{"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":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_export_deck_api_v1_ai_reporting_decks__deck_id__export_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ExportDeckResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"export_deck_api_v1_ai_reporting_decks__deck_id__export_post"}},"/api/v1/ai-reporting/decks/{deck_id}/share":{"post":{"tags":["ai-reporting"],"summary":"Create a public share link for a deck","description":"Mint a SHA-256 token-protected public share URL. The raw token is returned in this response exactly once — store or display it immediately. Subsequent listings only show metadata (no token).","operationId":"create_share","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck 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/CreateShareRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ShareLinkResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"create_share_api_v1_ai_reporting_decks__deck_id__share_post"}},"/api/v1/ai-reporting/decks/{deck_id}/shares":{"get":{"tags":["ai-reporting"],"summary":"List share links for a deck","description":"All share links (active and revoked) ordered newest first.","operationId":"list_shares","parameters":[{"name":"deck_id","in":"path","required":true,"schema":{"type":"string","title":"Deck 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_DeckShareList_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"list_shares_api_v1_ai_reporting_decks__deck_id__shares_get"}},"/api/v1/ai-reporting/shares/{share_id}":{"delete":{"tags":["ai-reporting"],"summary":"Revoke a share link","description":"Mark the share as revoked. The public viewer returns 404 after.","operationId":"revoke_share","parameters":[{"name":"share_id","in":"path","required":true,"schema":{"type":"string","title":"Share 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/app__core__success__MessageResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"revoke_share_api_v1_ai_reporting_shares__share_id__delete"}}},"components":{"schemas":{"AddSlideRequest":{"properties":{"slide_type":{"type":"string","enum":["cover","exec_summary","pnl_summary","ar_aging","cash_position","inventory_cogs","customer_concentration","asks","custom"],"title":"Slide Type","description":"Slide to add. Data-bound types are populated from live CFO portal data; 'custom' uses the supplied markdown. 'cover' cannot be added (a deck already has one)."},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"},"markdown":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Markdown","description":"Body content for custom slides."},"position":{"anyOf":[{"type":"integer","maximum":999.0,"minimum":0.0},{"type":"null"}],"title":"Position","description":"Insert position (0-based). Defaults to end of deck."}},"additionalProperties":false,"type":"object","required":["slide_type"],"title":"AddSlideRequest","description":"Body for ``POST /ai-reporting/decks/{deck_id}/slides``."},"ArAgingBucket":{"properties":{"label":{"type":"string","title":"Label"},"amount_cents":{"type":"integer","title":"Amount Cents"},"invoice_count":{"type":"integer","title":"Invoice Count"}},"additionalProperties":false,"type":"object","required":["label","amount_cents","invoice_count"],"title":"ArAgingBucket"},"ArAgingOverdue":{"properties":{"customer_name":{"type":"string","title":"Customer Name"},"amount_cents":{"type":"integer","title":"Amount Cents"},"days_past_due":{"type":"integer","title":"Days Past Due"}},"additionalProperties":false,"type":"object","required":["customer_name","amount_cents","days_past_due"],"title":"ArAgingOverdue"},"ArAgingSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"ar_aging","title":"Slide Type","default":"ar_aging"},"data":{"$ref":"#/components/schemas/ArAgingSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"ArAgingSlide"},"ArAgingSlideData":{"properties":{"total_outstanding_cents":{"type":"integer","title":"Total Outstanding Cents"},"buckets":{"items":{"$ref":"#/components/schemas/ArAgingBucket"},"type":"array","maxItems":8,"title":"Buckets"},"top_overdue":{"items":{"$ref":"#/components/schemas/ArAgingOverdue"},"type":"array","maxItems":12,"title":"Top Overdue"}},"additionalProperties":false,"type":"object","required":["total_outstanding_cents"],"title":"ArAgingSlideData"},"AskItem":{"properties":{"title":{"type":"string","title":"Title"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"kind":{"anyOf":[{"type":"string","enum":["decision","fyi","discussion"]},{"type":"null"}],"title":"Kind"}},"additionalProperties":false,"type":"object","required":["title"],"title":"AskItem"},"AsksSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"asks","title":"Slide Type","default":"asks"},"data":{"$ref":"#/components/schemas/AsksSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"AsksSlide"},"AsksSlideData":{"properties":{"asks":{"items":{"$ref":"#/components/schemas/AskItem"},"type":"array","maxItems":10,"title":"Asks"}},"additionalProperties":false,"type":"object","title":"AsksSlideData"},"Body_export_deck_api_v1_ai_reporting_decks__deck_id__export_post":{"properties":{"slides":{"anyOf":[{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array"},{"type":"null"}],"title":"Slides"}},"type":"object","title":"Body_export_deck_api_v1_ai_reporting_decks__deck_id__export_post"},"CashPositionSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"cash_position","title":"Slide Type","default":"cash_position"},"data":{"$ref":"#/components/schemas/CashPositionSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"CashPositionSlide"},"CashPositionSlideData":{"properties":{"current_cash_cents":{"type":"integer","title":"Current Cash Cents"},"series":{"items":{"$ref":"#/components/schemas/CashSeriesPoint"},"type":"array","maxItems":400,"title":"Series"},"burn_rate_cents_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Burn Rate Cents Per Month"},"runway_months":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Runway Months"}},"additionalProperties":false,"type":"object","required":["current_cash_cents"],"title":"CashPositionSlideData"},"CashSeriesPoint":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"cash_cents":{"type":"integer","title":"Cash Cents"}},"additionalProperties":false,"type":"object","required":["date","cash_cents"],"title":"CashSeriesPoint"},"CoverSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"cover","title":"Slide Type","default":"cover"},"data":{"$ref":"#/components/schemas/CoverSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"CoverSlide"},"CoverSlideData":{"properties":{"business_name":{"type":"string","title":"Business Name"},"period_label":{"type":"string","title":"Period Label"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"prepared_for":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prepared For"},"prepared_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prepared By"},"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"}},"additionalProperties":false,"type":"object","required":["business_name","period_label","generated_at"],"title":"CoverSlideData"},"CreateShareRequest":{"properties":{"expires_in_hours":{"anyOf":[{"type":"integer","maximum":8760.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Hours"},"slug":{"anyOf":[{"type":"string","maxLength":80,"pattern":"^[a-z0-9-]+$"},{"type":"null"}],"title":"Slug"}},"additionalProperties":false,"type":"object","title":"CreateShareRequest","description":"Body for ``POST /ai-reporting/decks/{deck_id}/share``."},"CursorPaginatedResponse_DeckListItem_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeckListItem"},"type":"array","title":"Items","description":"List of items"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total","description":"Total number of items (null when not calculated for performance)"},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Pagination limit"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor for next page"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor","description":"Cursor for previous page"},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there are more items"},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there are previous items"}},"type":"object","required":["items","has_next","has_prev"],"title":"CursorPaginatedResponse[DeckListItem]"},"CustomSlideData":{"properties":{"markdown":{"type":"string","maxLength":8000,"title":"Markdown"}},"additionalProperties":false,"type":"object","required":["markdown"],"title":"CustomSlideData"},"CustomSlideSpec":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"custom","title":"Slide Type","default":"custom"},"data":{"$ref":"#/components/schemas/CustomSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"CustomSlideSpec"},"CustomerConcentrationRow":{"properties":{"customer_name":{"type":"string","title":"Customer Name"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"pct_of_revenue":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Pct Of Revenue"}},"additionalProperties":false,"type":"object","required":["customer_name","revenue_cents","pct_of_revenue"],"title":"CustomerConcentrationRow"},"CustomerConcentrationSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"customer_concentration","title":"Slide Type","default":"customer_concentration"},"data":{"$ref":"#/components/schemas/CustomerConcentrationSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"CustomerConcentrationSlide"},"CustomerConcentrationSlideData":{"properties":{"total_revenue_cents":{"type":"integer","title":"Total Revenue Cents"},"top_customers":{"items":{"$ref":"#/components/schemas/CustomerConcentrationRow"},"type":"array","maxItems":12,"title":"Top Customers"},"concentration_index":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Concentration Index"}},"additionalProperties":false,"type":"object","required":["total_revenue_cents"],"title":"CustomerConcentrationSlideData"},"DeckListItem":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"slide_count":{"type":"integer","title":"Slide Count"}},"additionalProperties":false,"type":"object","required":["id","title","created_at","slide_count"],"title":"DeckListItem","description":"Skinny projection used by the list endpoint — no slide payload."},"DeckShareList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeckShareListItem"},"type":"array","title":"Items"}},"additionalProperties":false,"type":"object","title":"DeckShareList"},"DeckShareListItem":{"properties":{"id":{"type":"string","title":"Id"},"deck_id":{"type":"string","title":"Deck Id"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"view_count":{"type":"integer","title":"View Count","default":0},"last_viewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Viewed At"}},"additionalProperties":false,"type":"object","required":["id","deck_id","created_at"],"title":"DeckShareListItem","description":"Skinny listing of existing shares for a deck — no raw token."},"DeckSpec":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"title":{"type":"string","title":"Title"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End"},"slides":{"items":{"oneOf":[{"$ref":"#/components/schemas/CoverSlide"},{"$ref":"#/components/schemas/ExecSummarySlide"},{"$ref":"#/components/schemas/PnlSummarySlide"},{"$ref":"#/components/schemas/ArAgingSlide"},{"$ref":"#/components/schemas/CashPositionSlide"},{"$ref":"#/components/schemas/InventoryCogsSlide"},{"$ref":"#/components/schemas/CustomerConcentrationSlide"},{"$ref":"#/components/schemas/AsksSlide"},{"$ref":"#/components/schemas/CustomSlideSpec"}],"discriminator":{"propertyName":"slide_type","mapping":{"ar_aging":"#/components/schemas/ArAgingSlide","asks":"#/components/schemas/AsksSlide","cash_position":"#/components/schemas/CashPositionSlide","cover":"#/components/schemas/CoverSlide","custom":"#/components/schemas/CustomSlideSpec","customer_concentration":"#/components/schemas/CustomerConcentrationSlide","exec_summary":"#/components/schemas/ExecSummarySlide","inventory_cogs":"#/components/schemas/InventoryCogsSlide","pnl_summary":"#/components/schemas/PnlSummarySlide"}}},"type":"array","maxItems":40,"title":"Slides"},"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"},"theme":{"anyOf":[{"$ref":"#/components/schemas/DeckTheme"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["id","business_id","title","created_at"],"title":"DeckSpec","description":"The full deck payload — exactly what the FE renderer consumes."},"DeckTheme":{"properties":{"accent_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accent Color"},"cover_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cover Image Url"}},"additionalProperties":false,"type":"object","title":"DeckTheme"},"ExecSummaryKpi":{"properties":{"label":{"type":"string","title":"Label"},"value":{"type":"string","title":"Value"},"delta_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delta Label"},"trend":{"anyOf":[{"type":"string","enum":["up","down","flat"]},{"type":"null"}],"title":"Trend"}},"additionalProperties":false,"type":"object","required":["label","value"],"title":"ExecSummaryKpi"},"ExecSummarySlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"exec_summary","title":"Slide Type","default":"exec_summary"},"data":{"$ref":"#/components/schemas/ExecSummarySlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"ExecSummarySlide"},"ExecSummarySlideData":{"properties":{"kpis":{"items":{"$ref":"#/components/schemas/ExecSummaryKpi"},"type":"array","maxItems":8,"title":"Kpis"},"highlights":{"items":{"type":"string"},"type":"array","maxItems":8,"title":"Highlights"}},"additionalProperties":false,"type":"object","title":"ExecSummarySlideData"},"ExportDeckResponse":{"properties":{},"additionalProperties":true,"type":"object","title":"ExportDeckResponse","description":"``export_deck`` returns a binary ``StreamingResponse``; schema is docs-only."},"GenerateDeckRequest":{"properties":{"prompt":{"type":"string","maxLength":400,"minLength":1,"title":"Prompt"},"period_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Period End"},"slide_types":{"anyOf":[{"items":{"type":"string","enum":["cover","exec_summary","pnl_summary","ar_aging","cash_position","inventory_cogs","customer_concentration","asks","custom"]},"type":"array"},{"type":"null"}],"title":"Slide Types","description":"Optional subset of slide types to include. When omitted the service picks a sensible default for board / investor decks."},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"}},"additionalProperties":false,"type":"object","required":["prompt"],"title":"GenerateDeckRequest","description":"Body for ``POST /ai-reporting/decks`` — kick off a fresh deck."},"GenerateDeckResponse":{"properties":{"deck":{"$ref":"#/components/schemas/DeckSpec"}},"additionalProperties":false,"type":"object","required":["deck"],"title":"GenerateDeckResponse","description":"Returned from generation and refresh endpoints. Wraps the full deck."},"InventoryCogsSlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"inventory_cogs","title":"Slide Type","default":"inventory_cogs"},"data":{"$ref":"#/components/schemas/InventoryCogsSlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"InventoryCogsSlide"},"InventoryCogsSlideData":{"properties":{"inventory_value_cents":{"type":"integer","title":"Inventory Value Cents"},"inventory_days_on_hand":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Inventory Days On Hand"},"cogs_last_period_cents":{"type":"integer","title":"Cogs Last Period Cents"},"top_skus":{"items":{"$ref":"#/components/schemas/InventoryTopSku"},"type":"array","maxItems":12,"title":"Top Skus"}},"additionalProperties":false,"type":"object","required":["inventory_value_cents","cogs_last_period_cents"],"title":"InventoryCogsSlideData"},"InventoryTopSku":{"properties":{"sku":{"type":"string","title":"Sku"},"name":{"type":"string","title":"Name"},"qty_on_hand":{"type":"integer","title":"Qty On Hand"},"value_cents":{"type":"integer","title":"Value Cents"}},"additionalProperties":false,"type":"object","required":["sku","name","qty_on_hand","value_cents"],"title":"InventoryTopSku"},"PnlMonthRow":{"properties":{"label":{"type":"string","title":"Label"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"cogs_cents":{"type":"integer","title":"Cogs Cents"},"opex_cents":{"type":"integer","title":"Opex Cents"},"net_income_cents":{"type":"integer","title":"Net Income Cents"}},"additionalProperties":false,"type":"object","required":["label","revenue_cents","cogs_cents","opex_cents","net_income_cents"],"title":"PnlMonthRow"},"PnlSummarySlide":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","maxLength":200,"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"display_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Display Order","default":0},"hidden":{"type":"boolean","title":"Hidden","default":false},"slide_type":{"type":"string","const":"pnl_summary","title":"Slide Type","default":"pnl_summary"},"data":{"$ref":"#/components/schemas/PnlSummarySlideData"}},"additionalProperties":false,"type":"object","required":["id","title","data"],"title":"PnlSummarySlide"},"PnlSummarySlideData":{"properties":{"period_label":{"type":"string","title":"Period Label"},"months":{"items":{"$ref":"#/components/schemas/PnlMonthRow"},"type":"array","maxItems":24,"title":"Months"},"totals":{"$ref":"#/components/schemas/PnlTotals"}},"additionalProperties":false,"type":"object","required":["period_label","totals"],"title":"PnlSummarySlideData"},"PnlTotals":{"properties":{"revenue_cents":{"type":"integer","title":"Revenue Cents"},"cogs_cents":{"type":"integer","title":"Cogs Cents"},"gross_profit_cents":{"type":"integer","title":"Gross Profit Cents"},"opex_cents":{"type":"integer","title":"Opex Cents"},"net_income_cents":{"type":"integer","title":"Net Income Cents"},"gross_margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gross Margin Pct"},"net_margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Margin Pct"}},"additionalProperties":false,"type":"object","required":["revenue_cents","cogs_cents","gross_profit_cents","opex_cents","net_income_cents"],"title":"PnlTotals"},"RefreshDeckRequest":{"properties":{"regenerate_commentary":{"type":"boolean","title":"Regenerate Commentary","description":"Also regenerate AI commentary for the refreshed slides. Off by default so human-edited commentary survives a refresh.","default":false}},"additionalProperties":false,"type":"object","title":"RefreshDeckRequest","description":"Body for ``POST /ai-reporting/decks/{deck_id}/refresh``."},"ReorderSlidesRequest":{"properties":{"slide_ids":{"items":{"type":"string"},"type":"array","maxItems":40,"minItems":1,"title":"Slide Ids"}},"additionalProperties":false,"type":"object","required":["slide_ids"],"title":"ReorderSlidesRequest"},"ShareLinkResponse":{"properties":{"share_id":{"type":"string","title":"Share Id"},"deck_id":{"type":"string","title":"Deck Id"},"token":{"type":"string","title":"Token"},"url":{"type":"string","title":"Url"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"}},"additionalProperties":false,"type":"object","required":["share_id","deck_id","token","url"],"title":"ShareLinkResponse","description":"Returned exactly once at creation; raw token never re-emitted."},"SlideClaim":{"properties":{"text":{"type":"string","maxLength":600,"title":"Text"},"citations":{"items":{"$ref":"#/components/schemas/SlideSourceRef"},"type":"array","maxItems":6,"title":"Citations"}},"additionalProperties":false,"type":"object","required":["text"],"title":"SlideClaim","description":"A grounded paragraph/bullet rendered in the slide commentary block."},"SlideCommentary":{"properties":{"headline":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Headline"},"claims":{"items":{"$ref":"#/components/schemas/SlideClaim"},"type":"array","maxItems":8,"title":"Claims"},"recommendation":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Recommendation"},"trace_id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Trace Id"}},"additionalProperties":false,"type":"object","title":"SlideCommentary","description":"AI commentary block attached to a slide."},"SlideSourceRef":{"properties":{"source":{"type":"string","title":"Source","description":"Underlying section, e.g. 'ar_aging'."},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path","description":"Optional dotted JSON path inside ``slide.data``, e.g. 'buckets.over_90.amount_cents'."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable badge label."}},"additionalProperties":false,"type":"object","required":["source"],"title":"SlideSourceRef","description":"A pointer back to the slide data that supports an AI claim.\n\nMirrors the looser :class:`app.ai.contracts.SourceRef` but constrained to\nreferences inside a single slide so the public/share viewer can render\ncitation badges without exposing internal lookup keys."},"SuccessEnvelope_Annotated_Union_CoverSlide__ExecSummarySlide__PnlSummarySlide__ArAgingSlide__CashPositionSlide__InventoryCogsSlide__CustomerConcentrationSlide__AsksSlide__CustomSlideSpec___FieldInfo_annotation_NoneType__required_True__discriminator__slide_type____":{"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":[{"oneOf":[{"$ref":"#/components/schemas/CoverSlide"},{"$ref":"#/components/schemas/ExecSummarySlide"},{"$ref":"#/components/schemas/PnlSummarySlide"},{"$ref":"#/components/schemas/ArAgingSlide"},{"$ref":"#/components/schemas/CashPositionSlide"},{"$ref":"#/components/schemas/InventoryCogsSlide"},{"$ref":"#/components/schemas/CustomerConcentrationSlide"},{"$ref":"#/components/schemas/AsksSlide"},{"$ref":"#/components/schemas/CustomSlideSpec"}],"discriminator":{"propertyName":"slide_type","mapping":{"ar_aging":"#/components/schemas/ArAgingSlide","asks":"#/components/schemas/AsksSlide","cash_position":"#/components/schemas/CashPositionSlide","cover":"#/components/schemas/CoverSlide","custom":"#/components/schemas/CustomSlideSpec","customer_concentration":"#/components/schemas/CustomerConcentrationSlide","exec_summary":"#/components/schemas/ExecSummarySlide","inventory_cogs":"#/components/schemas/InventoryCogsSlide","pnl_summary":"#/components/schemas/PnlSummarySlide"}}},{"type":"null"}],"title":"Data"}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[Annotated[Union[CoverSlide, ExecSummarySlide, PnlSummarySlide, ArAgingSlide, CashPositionSlide, InventoryCogsSlide, CustomerConcentrationSlide, AsksSlide, CustomSlideSpec], FieldInfo(annotation=NoneType, required=True, discriminator='slide_type')]]"},"SuccessEnvelope_CursorPaginatedResponse_DeckListItem__":{"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/CursorPaginatedResponse_DeckListItem_"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CursorPaginatedResponse[DeckListItem]]"},"SuccessEnvelope_DeckShareList_":{"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/DeckShareList"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DeckShareList]"},"SuccessEnvelope_DeckSpec_":{"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/DeckSpec"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DeckSpec]"},"SuccessEnvelope_ExportDeckResponse_":{"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/ExportDeckResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ExportDeckResponse]"},"SuccessEnvelope_GenerateDeckResponse_":{"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/GenerateDeckResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[GenerateDeckResponse]"},"SuccessEnvelope_ShareLinkResponse_":{"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/ShareLinkResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ShareLinkResponse]"},"UpdateSlideRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"},"commentary":{"anyOf":[{"$ref":"#/components/schemas/SlideCommentary"},{"type":"null"}]},"hidden":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hidden"},"markdown":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Markdown","description":"Replace the body content. Custom slides only."}},"additionalProperties":false,"type":"object","title":"UpdateSlideRequest","description":"Body for ``PATCH /ai-reporting/decks/{deck_id}/slides/{slide_id}``."},"app__core__success__MessageResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"additionalProperties":true,"type":"object","title":"MessageResponse","description":"Envelope for data-less mutations: ``{success, message, code}``, no ``data``.\n\nCanonical ``response_model`` for deletes and other message-only mutations so\nthe generated TypeScript client gets a single, named ``MessageResponse`` type\ninstead of dozens of empty per-route stubs. Pairs with the\n``SuccessResponse.*`` builders (which already emit this exact shape)."},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}