Generate Proposal Template
Proposal Workflow
Generate Proposal Template
POST
Generate Proposal Template
Overview
Generates a Word (.docx) template document from the structure and workplan analysis. This endpoint creates a downloadable template with sections, guidance, and space for writing content.This endpoint generates a blank template with structure and guidance. For an AI-generated draft with pre-filled content, use
/generate-ai-proposal-template instead.Request
The proposal ID or code (format:
PROP-YYYYMMDD-XXXX)Optional list of section titles to include. If not provided or empty, all sections from the structure analysis will be included.Example:
["Executive Summary", "Technical Approach", "Budget"]Optional dictionary mapping section titles to user comments. Comments will be displayed in blue italic text in the document.Example:
{"Technical Approach": "Focus on cloud-native architecture"}Response
Returns a streamable Word document (.docx file) with:
- Content-Type:
application/vnd.openxmlformats-officedocument.wordprocessingml.document - Content-Disposition:
attachment; filename=proposal_template_{proposal_code}.docx
Word document binary stream
Example Request
JavaScript/TypeScript Example
Generated Document Structure
The Word template includes:Document Header
- Proposal Title: From proposal metadata
- Proposal Code: PROP-YYYYMMDD-XXXX
- Date Generated: Current date
Narrative Overview
A text summary from the structure workplan analysis explaining the overall approach.Each Section Contains
- Section Title: Formatted as heading
- Purpose: Why this section is important
- Guidance: What to include in the section
- Key Questions: Prompts to guide writing
- User Comments (if provided): Displayed in blue italic text
- Writing Space: Blank space for user to add content
Example Section Format
Service Implementation
The template is generated using theProposalTemplateGenerator service:
Input Data Sources
The generator pulls data from multiple analysis steps:| Analysis Type | Used For |
|---|---|
| RFP Analysis | Requirements, evaluation criteria |
| Concept Document | Project overview, initial approach |
| Structure Workplan | Section titles, guidance, questions |
| Reference Proposals | Best practice examples |
| Existing Work | Organizational context |
Error Handling
Status Code 400 - Missing Structure Analysis
Status Code 400 - Missing RFP Analysis
Status Code 400 - Missing Concept Document
Status Code 403
Status Code 404
Status Code 500
Section Selection
Users can choose which sections to include:Include All Sections (Default)
Include Specific Sections
Section titles must match exactly with titles in the structure workplan analysis. Mismatched titles will be ignored.
User Comments Feature
Add custom guidance for each section:Comment Display
Comments appear in the document as:- Blue text color
- Italic style
- Indented for visibility
Comparison: Template vs AI-Generated Draft
| Feature | Template (This Endpoint) | AI Draft (/generate-ai-proposal-template) |
|---|---|---|
| Content | Empty sections with guidance | Pre-filled with AI-generated content |
| Generation Time | Instant (under 1 second) | 2-5 minutes (async) |
| User Control | User writes all content | AI generates, user edits |
| Best For | Experienced writers | Quick first drafts |
| File Format | Word (.docx) | Markdown (convertible to .docx) |
Next Steps
After downloading the template:- Open in Word: Edit the document offline
- Fill Sections: Replace placeholder text with your content
- Upload as Draft: Upload completed document for feedback analysis
POST /api/proposals/{proposal_id}/upload-draft-proposal
Upload your completed draft for AI feedback
Alternative: AI-Generated Draft
If you prefer AI to generate initial content:POST /api/proposals/{proposal_id}/generate-ai-proposal-template
Generate AI-powered draft with pre-filled sections
Best Practices
Use comments for team coordination: Add user comments to communicate priorities or constraints to team members writing specific sections.