---
title: "Compose Feasibility Pdf"
method: POST
path: "/api/v1/cd-feasibility/compose-pdf"
tags: ["casa-daily-feasibility"]
---

# Compose Feasibility Pdf

`POST /api/v1/cd-feasibility/compose-pdf`

## Request

- Base URL: `https://api.casaintelligence.com.au` (the document declares no server; this is the origin it was published from)
- URL: `https://api.casaintelligence.com.au/api/v1/cd-feasibility/compose-pdf`
- Auth: API key in header `X-API-Key`

Compile the assembled feasibility into a Typst PDF and return bytes.

Uses the bespoke ``casa_daily_v2_feasibility.typ`` template — built
for this exact payload shape with embedded site-analysis SVG, AICR
breakdown, comparable approvals table, predicted-conditions table,
financial variables snapshot, and the Casa Planner upsell section.

Fetches the cached site-analysis SVG for the property (if available)
and writes it as ``site_analysis.svg`` in the render dir so the
template's ``image()`` call resolves it.

Auto-generates AI narrative sections (executive_summary,
site_assessment, infrastructure_charges_commentary,
comparable_approvals_commentary, casa_planner_pathway,
financial_outlook) via Sonnet so each PDF reads in real planner
voice with the data woven into the prose, rather than as a sparse
fact-table.

## Request body

- FeasibilityPDFRequest: Casa Daily sends the full assembled payload it intends to print. The user may have edited inputs in the variables-sheet card before clicking 'Generate feasibility report', so the source of truth for the PDF is the post-edit payload, not the original /compose response. The AI narrative comes from Casa Daily's curated chat synthesis — it's NOT regenerated server-side here so the PDF matches what the user saw on screen.
  - `payload` FeasibilityComposePayload, required: The full deterministic payload Casa Daily renders as inline cards.
    - `property` object, required
    - `feasibility` object, required
    - `infrastructure_charges` object, required
    - `predicted_conditions` object[], required
    - `assessment_levels` object[], required
    - `timeline` object, required
    - `nearby_das` object[], required
    - `da_pathway` object, required
    - `required_documents` object[], required
    - `consultant_package` object, required
    - `informational_only` boolean
    - `disclaimer` string
  - `project_name` string, required
  - `user_full_name` string, nullable
  - `user_email` string, nullable
  - `ai_narrative` object: AI-generated narrative sections keyed by name: executive_summary, site_assessment, casa_planner_pathway, etc.
  - `casa_planner_section` object: The Casa Planner upsell block — likelihood, required docs, consultant pack, cost-to-DA, marketing CTA. Optional but expected for the launch pitch.
  - `variables_snapshot` object: User-edited financial variables sheet at PDF compile time (purchase_price, unit_count, build_cost_per_unit, etc.)
  - `variables_outputs` object: Computed financial outputs from the variables sheet (profit, margin_pct, total_project_cost, breakeven_sale_price_per_unit, etc.)
  - `dev_type` string, nullable
  - `unit_count` integer, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/casaintelligence/apis/casa-intelligence-engine.md) · [All operations](https://skmtc.dev/casaintelligence/apis/casa-intelligence-engine/llms.txt) · [OpenAPI document](https://skmtc.dev/casaintelligence/apis/casa-intelligence-engine/revisions/71d711039de0?raw)
