{"openapi":"3.1.0","info":{"title":"GET /api/v1/advisory-packs/{pack_id}","version":"1.0.0","description":"Get an advisory pack"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/advisory-packs/{pack_id}":{"get":{"tags":["advisory-packs"],"summary":"Get an advisory pack","description":"Get one pack with its sections and figures.","operationId":"get_advisory_pack","parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack 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_AdvisoryPackResponse_"}}}},"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_advisory_pack_api_v1_advisory_packs__pack_id__get"}}},"components":{"schemas":{"AdvisoryGoals":{"properties":{"target_close_business_day":{"anyOf":[{"type":"integer","maximum":15.0,"minimum":1.0},{"type":"null"}],"title":"Target Close Business Day"},"cash_floor_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Cash Floor Cents"},"gross_margin_target_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Gross Margin Target Pct"}},"additionalProperties":false,"type":"object","title":"AdvisoryGoals","description":"Per-business goals the pack shows progress toward."},"AdvisoryPackResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"period":{"type":"string","format":"date","title":"Period"},"period_label":{"type":"string","title":"Period Label"},"status":{"type":"string","title":"Status","description":"queued, ready or failed"},"approval_status":{"type":"string","enum":["draft","approved"],"title":"Approval Status"},"sections":{"items":{"$ref":"#/components/schemas/PackSection"},"type":"array","title":"Sections"},"goals":{"anyOf":[{"$ref":"#/components/schemas/AdvisoryGoals"},{"type":"null"}]},"trust_grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trust Grade"},"generated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated By"},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"shared":{"type":"boolean","title":"Shared","description":"A public link is active","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"additionalProperties":false,"type":"object","required":["id","business_id","period","period_label","status","approval_status","created_at"],"title":"AdvisoryPackResponse","description":"One pack as the signed-in business sees it."},"LineageRef":{"properties":{"kind":{"type":"string","enum":["ledger","report"],"title":"Kind"},"label":{"type":"string","title":"Label"},"ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Id"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"href":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Href","description":"In-app path of the report"}},"additionalProperties":false,"type":"object","required":["kind","label"],"title":"LineageRef","description":"Where a figure comes from.\n\n``kind == \"ledger\"``: open ``/cfo-portal/flux/lineage`` for ``ledger_id``\nover ``start_date``..``end_date``. ``kind == \"report\"``: ``href`` is the\nin-app report that shows the figure."},"PackFigure":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"unit":{"type":"string","enum":["cents","percent","days","months","count","grade","text"],"title":"Unit"},"value_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Value Cents"},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Value"},"display":{"type":"string","title":"Display","description":"The figure as it is written in the pack"},"lineage_ref":{"$ref":"#/components/schemas/LineageRef"}},"additionalProperties":false,"type":"object","required":["key","label","unit","display","lineage_ref"],"title":"PackFigure","description":"One number (or short fact) in a section."},"PackSection":{"properties":{"key":{"type":"string","title":"Key"},"title":{"type":"string","title":"Title"},"narrative":{"type":"string","title":"Narrative"},"narrative_source":{"type":"string","enum":["model","template"],"title":"Narrative Source","default":"template"},"figures":{"items":{"$ref":"#/components/schemas/PackFigure"},"type":"array","title":"Figures"}},"additionalProperties":false,"type":"object","required":["key","title","narrative"],"title":"PackSection","description":"A titled block: a narrative and the figures it may cite."},"SuccessEnvelope_AdvisoryPackResponse_":{"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/AdvisoryPackResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AdvisoryPackResponse]"},"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":[]}]}