Skip to main content

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.
Alpha Feature: Template generation is currently in alpha. The API may change without notice and should not be used in production environments without careful consideration. See the Alpha API Authentication guide for access details.

Authentication

The Alpha API uses Bearer token authentication:
This differs from the stable API which uses the 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 a pending 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

  1. Generate: Start with a description of the template you need
  2. Test: Use the generated template with actual transcriptions
  3. Review: Evaluate the note output for missing sections or formatting issues
  4. Refine: Use refinement mode with specific feedback
  5. Repeat: Continue testing and refining until satisfied
  6. 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

  1. Review before production: Always test generated templates with real transcriptions before deploying
  2. Iterate incrementally: Make small, focused refinements rather than large changes
  3. Document your templates: Keep notes on what each template is designed for
  4. Version control: Track template versions to revert if needed
  5. Combine with manual edits: You can manually adjust the generated template JSON before use

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