Skip to main content
DELETE
https://api-dev.weir.ai/
/
mail
/
template
/
:id
curl -X DELETE 'https://api.weir.ai/mail/template/tpl_123456789' \
  -H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN'
{
  "message": "Template deleted successfully",
  "status": "success"
}

Delete Mail Template

Delete an email template from the system.
Caution: This action cannot be undone. Ensure no active processes depend on this template.
curl -X DELETE 'https://api.weir.ai/mail/template/tpl_123456789' \
  -H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN'
{
  "message": "Template deleted successfully",
  "status": "success"
}

Path Parameters

id
string
required
Template ID to delete.

Usage Examples

const deleteMailTemplate = async (templateId, accessToken) => {
  const response = await fetch(`https://api.weir.ai/mail/template/${templateId}`, {
    method: 'DELETE',
    headers: { 'Authorization': `Bearer ${accessToken}` }
  });
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return await response.json();
};