curl -X DELETE "https://api.sully.ai/alpha/note-templates/template_abc123def456" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.sully.ai/alpha/note-templates/template_abc123def456', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
if (response.ok) {
console.log('Note template job deleted successfully');
} else {
console.error('Failed to delete note template job');
}
import requests
url = "https://api.sully.ai/alpha/note-templates/template_abc123def456"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
if response.status_code == 204:
print("Note template job deleted successfully")
else:
print(f"Failed to delete note template job: {response.status_code}")
// No response body - successful deletion
Alpha API Reference
Delete Note Template Job
Delete a note template job (generation or refinement) by its unique identifier.
DELETE
/
alpha
/
note-templates
/
{id}
curl -X DELETE "https://api.sully.ai/alpha/note-templates/template_abc123def456" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.sully.ai/alpha/note-templates/template_abc123def456', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
if (response.ok) {
console.log('Note template job deleted successfully');
} else {
console.error('Failed to delete note template job');
}
import requests
url = "https://api.sully.ai/alpha/note-templates/template_abc123def456"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
if response.status_code == 204:
print("Note template job deleted successfully")
else:
print(f"Failed to delete note template job: {response.status_code}")
// No response body - successful deletion
Overview
Permanently delete a note template job and all associated data. This action cannot be undone and works for both generation and refinement jobs.This action is irreversible. Once a template job is deleted, it cannot be recovered. Make sure you have saved any important results before deletion.
Path Parameters
Response
This endpoint returns no content on successful deletion.curl -X DELETE "https://api.sully.ai/alpha/note-templates/template_abc123def456" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.sully.ai/alpha/note-templates/template_abc123def456', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
if (response.ok) {
console.log('Note template job deleted successfully');
} else {
console.error('Failed to delete note template job');
}
import requests
url = "https://api.sully.ai/alpha/note-templates/template_abc123def456"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
if response.status_code == 204:
print("Note template job deleted successfully")
else:
print(f"Failed to delete note template job: {response.status_code}")
// No response body - successful deletion
Status Codes
Use Cases
Cleanup Completed Jobs
Delete old template jobs that are no longer needed:async function cleanupOldTemplateJobs() {
// Assuming you have a way to list jobs (not implemented in current API)
// This is a conceptual example
const oldJobIds = [
'template_old123',
'template_old456',
'template_old789'
];
for (const jobId of oldJobIds) {
try {
await fetch(`https://api.sully.ai/alpha/note-templates/${jobId}`, {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
console.log(`Deleted job: ${jobId}`);
} catch (error) {
console.error(`Failed to delete job ${jobId}:`, error);
}
}
}
Cancel Processing Jobs
Remove jobs that are no longer needed while they’re still processing (works for both generation and refinement jobs):async function cancelTemplateJob(jobId) {
try {
// First check if the job is still processing
const statusResponse = await fetch(`https://api.sully.ai/alpha/note-templates/${jobId}`, {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const statusData = await statusResponse.json();
if (statusData.data.status === 'processing' || statusData.data.status === 'pending') {
const deleteResponse = await fetch(`https://api.sully.ai/alpha/note-templates/${jobId}`, {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
if (deleteResponse.ok) {
console.log('Template job cancelled successfully');
} else {
console.error('Failed to cancel job');
}
} else {
console.log(`Job is ${statusData.data.status}, cannot cancel`);
}
} catch (error) {
console.error('Error cancelling job:', error);
}
}
Batch Deletion
Delete multiple template jobs at once:async function deleteMultipleJobs(jobIds) {
const deletePromises = jobIds.map(jobId =>
fetch(`https://api.sully.ai/alpha/note-templates/${jobId}`, {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
})
);
try {
const results = await Promise.allSettled(deletePromises);
results.forEach((result, index) => {
if (result.status === 'fulfilled' && result.value.ok) {
console.log(`Successfully deleted job: ${jobIds[index]}`);
} else {
console.error(`Failed to delete job: ${jobIds[index]}`);
}
});
} catch (error) {
console.error('Error in batch deletion:', error);
}
}
// Usage
const jobsToDelete = [
'template_abc123',
'template_def456',
'template_ghi789'
];
deleteMultipleJobs(jobsToDelete);
Important Notes
- Irreversible Action: Deleted template jobs cannot be recovered
- Results Loss: Any generated/refined templates and analysis insights will be permanently lost
- Processing Jobs: You can delete jobs even while they’re processing (both generation and refinement)
- Billing: You may still be charged for processing time even if you delete the job before completion
- No Cascading: Deleting a job does not affect any templates you may have already exported or saved elsewhere
Data Privacy
When you delete a note template job:- Generation Jobs: All uploaded provider notes, generated templates, and insights are permanently removed
- Refinement Jobs: Original templates, refined templates, and refinement analysis are permanently removed
- All analysis data and intermediate processing results are purged
- No trace of the job remains in our systems
Best Practices
Before Deletion
- Save Results: Export any templates or insights you want to keep
- Verify Job ID: Double-check the job ID to avoid accidental deletion
- Consider Timing: For processing jobs, consider waiting for completion if results might be useful
Cleanup Strategy
- Regular Cleanup: Periodically delete old, completed jobs to manage storage
- Failed Jobs: Promptly delete failed jobs unless you need to review error details
- Test Jobs: Clean up test or experimental jobs after reviewing results
Related Endpoints
- Create Note Template - Create a new template job
- Get Note Template - Retrieve a template job