curl -X POST "https://api.sully.ai/alpha/note-templates" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "generate",
"notes": [
{
"content": "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
"description": "Cardiology consultation note"
},
{
"content": "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
"description": "Heart failure follow-up"
}
],
"instructions": "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
}'
curl -X POST "https://api.sully.ai/alpha/note-templates" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "refine",
"template": {
"id": "existing-template-123",
"title": "Cardiology Consultation Template",
"sections": [...]
},
"instructions": "Add more detailed assessment prompts and include differential diagnosis section",
"note_comparison": {
"before": "Assessment: Chest pain, likely cardiac.",
"after": "Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS."
}
}'
const response = await fetch('https://api.sully.ai/alpha/note-templates', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mode: 'generate',
notes: [
{
content: "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
description: "Cardiology consultation note"
},
{
content: "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
description: "Heart failure follow-up"
}
],
instructions: "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
})
});
const data = await response.json();
console.log(data);
const response = await fetch('https://api.sully.ai/alpha/note-templates', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mode: 'refine',
template: {
id: 'existing-template-123',
title: 'Cardiology Consultation Template',
sections: [
// ... existing template sections
]
},
instructions: 'Add more detailed assessment prompts and include differential diagnosis section',
note_comparison: {
before: 'Assessment: Chest pain, likely cardiac.',
after: 'Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS.'
}
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.sully.ai/alpha/note-templates"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"mode": "generate",
"notes": [
{
"content": "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
"description": "Cardiology consultation note"
},
{
"content": "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
"description": "Heart failure follow-up"
}
],
"instructions": "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
import requests
url = "https://api.sully.ai/alpha/note-templates"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"mode": "refine",
"template": {
"id": "existing-template-123",
"title": "Cardiology Consultation Template",
"sections": [
# ... existing template sections
]
},
"instructions": "Add more detailed assessment prompts and include differential diagnosis section",
"note_comparison": {
"before": "Assessment: Chest pain, likely cardiac.",
"after": "Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS."
}
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
{
"data": {
"id": "template_abc123def456",
"mode": "generate",
"status": "pending",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
{
"data": {
"id": "template_xyz789ghi012",
"mode": "refine",
"status": "pending",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
Alpha API Reference
Create Note Template Job
Create a note template generation or refinement job to build or improve clinical documentation templates.
POST
/
alpha
/
note-templates
curl -X POST "https://api.sully.ai/alpha/note-templates" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "generate",
"notes": [
{
"content": "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
"description": "Cardiology consultation note"
},
{
"content": "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
"description": "Heart failure follow-up"
}
],
"instructions": "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
}'
curl -X POST "https://api.sully.ai/alpha/note-templates" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "refine",
"template": {
"id": "existing-template-123",
"title": "Cardiology Consultation Template",
"sections": [...]
},
"instructions": "Add more detailed assessment prompts and include differential diagnosis section",
"note_comparison": {
"before": "Assessment: Chest pain, likely cardiac.",
"after": "Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS."
}
}'
const response = await fetch('https://api.sully.ai/alpha/note-templates', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mode: 'generate',
notes: [
{
content: "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
description: "Cardiology consultation note"
},
{
content: "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
description: "Heart failure follow-up"
}
],
instructions: "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
})
});
const data = await response.json();
console.log(data);
const response = await fetch('https://api.sully.ai/alpha/note-templates', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mode: 'refine',
template: {
id: 'existing-template-123',
title: 'Cardiology Consultation Template',
sections: [
// ... existing template sections
]
},
instructions: 'Add more detailed assessment prompts and include differential diagnosis section',
note_comparison: {
before: 'Assessment: Chest pain, likely cardiac.',
after: 'Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS.'
}
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.sully.ai/alpha/note-templates"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"mode": "generate",
"notes": [
{
"content": "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
"description": "Cardiology consultation note"
},
{
"content": "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
"description": "Heart failure follow-up"
}
],
"instructions": "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
import requests
url = "https://api.sully.ai/alpha/note-templates"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"mode": "refine",
"template": {
"id": "existing-template-123",
"title": "Cardiology Consultation Template",
"sections": [
# ... existing template sections
]
},
"instructions": "Add more detailed assessment prompts and include differential diagnosis section",
"note_comparison": {
"before": "Assessment: Chest pain, likely cardiac.",
"after": "Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS."
}
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
{
"data": {
"id": "template_abc123def456",
"mode": "generate",
"status": "pending",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
{
"data": {
"id": "template_xyz789ghi012",
"mode": "refine",
"status": "pending",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
Overview
The unified note template endpoint supports two modes of operation:- Generation Mode: Analyzes provider notes to automatically create customized note templates from scratch
- Refinement Mode: Improves existing templates based on instructions or before/after note comparisons
Request Body
The request body varies depending on the operation mode:Generation Mode (Default)
Refinement Mode
Response
The created note template job
Show Note Template Job Object
Show Note Template Job Object
Current status of the job
pending: Job is queued for processingprocessing: Currently processing the requestcompleted: Processing complete, results availablefailed: Processing failed
The operation mode for this job
generate: Creating a template from provider notesrefine: Improving an existing template
Available when status is “completed” - contains the generated/refined template
curl -X POST "https://api.sully.ai/alpha/note-templates" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "generate",
"notes": [
{
"content": "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
"description": "Cardiology consultation note"
},
{
"content": "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
"description": "Heart failure follow-up"
}
],
"instructions": "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
}'
curl -X POST "https://api.sully.ai/alpha/note-templates" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "refine",
"template": {
"id": "existing-template-123",
"title": "Cardiology Consultation Template",
"sections": [...]
},
"instructions": "Add more detailed assessment prompts and include differential diagnosis section",
"note_comparison": {
"before": "Assessment: Chest pain, likely cardiac.",
"after": "Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS."
}
}'
const response = await fetch('https://api.sully.ai/alpha/note-templates', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mode: 'generate',
notes: [
{
content: "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
description: "Cardiology consultation note"
},
{
content: "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
description: "Heart failure follow-up"
}
],
instructions: "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
})
});
const data = await response.json();
console.log(data);
const response = await fetch('https://api.sully.ai/alpha/note-templates', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
mode: 'refine',
template: {
id: 'existing-template-123',
title: 'Cardiology Consultation Template',
sections: [
// ... existing template sections
]
},
instructions: 'Add more detailed assessment prompts and include differential diagnosis section',
note_comparison: {
before: 'Assessment: Chest pain, likely cardiac.',
after: 'Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS.'
}
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.sully.ai/alpha/note-templates"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"mode": "generate",
"notes": [
{
"content": "Chief Complaint: Patient presents with chest pain.\n\nHistory of Present Illness: 45-year-old male with acute onset chest pain, radiating to left arm. Pain started 2 hours ago while at rest.\n\nPhysical Exam: Vital signs stable. Heart rate 88 bpm, BP 140/90.\n\nAssessment: Possible acute coronary syndrome.\n\nPlan: ECG, troponin levels, cardiology consult.",
"description": "Cardiology consultation note"
},
{
"content": "Chief Complaint: Shortness of breath.\n\nHistory of Present Illness: 67-year-old female with progressive dyspnea over 3 days. No chest pain.\n\nPhysical Exam: Crackles bilateral lower lobes. JVD present.\n\nAssessment: Congestive heart failure exacerbation.\n\nPlan: Chest X-ray, BNP, diuretics, follow-up in 48 hours.",
"description": "Heart failure follow-up"
}
],
"instructions": "Focus on creating a template for cardiology consultations with emphasis on systematic assessment."
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
import requests
url = "https://api.sully.ai/alpha/note-templates"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"mode": "refine",
"template": {
"id": "existing-template-123",
"title": "Cardiology Consultation Template",
"sections": [
# ... existing template sections
]
},
"instructions": "Add more detailed assessment prompts and include differential diagnosis section",
"note_comparison": {
"before": "Assessment: Chest pain, likely cardiac.",
"after": "Assessment: Acute chest pain syndrome with features suggestive of unstable angina. Differential includes NSTEMI, aortic dissection, and pulmonary embolism. Risk stratification indicates intermediate probability for ACS."
}
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
{
"data": {
"id": "template_abc123def456",
"mode": "generate",
"status": "pending",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
{
"data": {
"id": "template_xyz789ghi012",
"mode": "refine",
"status": "pending",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
Status Codes
Invalid request body, missing required fields, or validation errors
- Generation Mode: Missing notes array, too many notes (maximum 5), empty note content, description too long (maximum 1000 characters)
- Refinement Mode: Missing template object, invalid template structure, note comparison validation errors
- Both Modes: Invalid mode value, malformed request structure
Validation Rules
Input Validation: The following validation rules apply:Generation Mode:
- Notes: Minimum 1, maximum 5 notes per request
- Content: Required for each note, cannot be empty
- Description: Optional, maximum 1000 characters per note
- Instructions: Optional
- Template: Required, must be a valid NoteTemplate object
- Instructions: Optional
- Note Comparison: Optional, both before and after content required if provided
- Description: Optional, maximum 1000 characters for note comparison
Next Steps
After creating a note template job:- Poll for results: Use the Get Note Template endpoint with the returned ID to check status and retrieve results
- Use webhooks: Configure webhooks to get notified when processing completes (recommended)
- Clean up: Use the Delete Note Template endpoint to remove jobs you no longer need
Best Practices
Generation Mode
Note Selection:- Quality over quantity: Use your best, most representative notes
- Consistency: Include notes with similar structure and style
- Completeness: Use complete notes rather than fragments
- Variety: Include different types of cases within the same specialty
- Be specific: “Focus on cardiology consultations” vs. “Make a good template”
- Mention priorities: “Emphasize differential diagnosis section”
- Include preferences: “Use bullet points for assessment and plan”
Refinement Mode
Template Preparation:- Use existing templates: Start with a working template that needs improvement
- Identify specific issues: Know what aspects need refinement
- Be precise: “Add severity scoring to assessment section”
- Reference sections: “Modify the plan section to include follow-up timeframes”
- Specify changes: “Change from paragraph to bullet point format”
- Use real examples: Provide actual before/after note content
- Show clear differences: Highlight specific improvements needed
- Include context: Explain why the changes are desired
Example Instructions
Generation Mode
{
"instructions": "Create a template for emergency department visits focusing on rapid assessment. Prioritize chief complaint, vital signs, and disposition. Use concise bullet points for efficiency."
}
Refinement Mode
{
"instructions": "Enhance the assessment section to include severity scoring (1-10), differential diagnosis with at least 3 options, and risk stratification. Convert plan from paragraph to structured list format with categories: Diagnostics, Medications, Follow-up."
}
Related Endpoints
- Get Note Template - Retrieve a template job and results
- Delete Note Template - Delete a template job