Overview
Template Generation is an AI-powered feature that helps you create and improve clinical note templates without manual authoring. Instead of building templates from scratch, you can describe what you need in natural language or provide an existing template for refinement. The feature operates in two modes:
This is particularly useful when you need custom note formats for specific specialties or workflows but do not want to manually define every section, prompt, and property.
Authentication
The Alpha API uses Bearer token authentication:X-API-Key header. Use the same API key you obtained from your Sully.ai dashboard.
Generation Mode
Generation mode creates a template from a natural language description. Describe the template structure, sections, and formatting preferences, and the AI will produce a valid NoteTemplate object.Endpoint
Request Body
Example Request
Response
The endpoint returns a job object with apending status:
Refinement Mode
Refinement mode improves an existing template based on your feedback. Provide the current template and describe what changes you want, and the AI will produce an updated version.Endpoint
Request Body
Example Request
Polling for Results
Template generation is asynchronous. After creating a job, poll the GET endpoint to check status and retrieve results.Endpoint
Status Flow
Polling Pattern
Understanding the Output
When a job completes successfully,result.template contains a valid NoteTemplate object that can be used directly with the POST /v1/notes endpoint.
Template Structure
Example Output
Using the Generated Template
Once you have the template, use it with the notes endpoint:Iteration Workflow
The recommended workflow for building production-ready templates:Step-by-Step
- Generate: Start with a description of the template you need
- Test: Use the generated template with actual transcriptions
- Review: Evaluate the note output for missing sections or formatting issues
- Refine: Use refinement mode with specific feedback
- Repeat: Continue testing and refining until satisfied
- Deploy: Use the final template in production
Example Iteration
Best Practices
Writing Effective Descriptions (Generation Mode)
Good description:
“Create a dermatology consultation template with sections for: skin lesion description (using ABCDE criteria), location and distribution, relevant history, differential diagnosis with at least 3 possibilities, biopsy recommendations, and follow-up plan. Use bullet points for differentials and numbered items for the plan.”Poor description:
“Make a skin doctor template”
Writing Effective Feedback (Refinement Mode)
Good feedback:
“Change the Assessment section prompt to include severity scoring on a 1-10 scale. Add a ‘Red Flags’ subsection under History that specifically asks about warning symptoms. Convert the Plan section from paragraph format to a numbered list with categories: Diagnostics, Medications, Referrals, Follow-up.”Poor feedback:
“Make the assessment better and add more sections”
General Guidelines
- Review before production: Always test generated templates with real transcriptions before deploying
- Iterate incrementally: Make small, focused refinements rather than large changes
- Document your templates: Keep notes on what each template is designed for
- Version control: Track template versions to revert if needed
- Combine with manual edits: You can manually adjust the generated template JSON before use
Related Resources
Note Template Schema
Complete schema reference for NoteTemplate objects
Note Customization Guide
Deep dive into note styles and templates
Create Note Template Job
Full API reference for the create endpoint
Alpha Authentication
Authentication details for alpha endpoints