Skip to content

Delete a template

Remove a template for good.

http
DELETE /v1/templates/{id}

Requires a Full access API key.

{id} is the template's id or its alias (the slug) — both resolve to the same template.

Path parameters

ParameterTypeRequiredDescription
idstringYesThe template id or its alias.

Example

bash
curl -X DELETE "https://api.sendgrail.com/v1/templates/$TEMPLATE_ID" \
  -H "Authorization: Bearer $SENDGRAIL_API_KEY"
js
await fetch(`https://api.sendgrail.com/v1/templates/${id}`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.SENDGRAIL_API_KEY}` },
});

Response

json
{
  "object": "template",
  "id": "d3f8c2a1-6b47-4e9a-b25c-1f0e7a9d4c83",
  "deleted": true
}

A send call that references a deleted template no longer resolves, so make sure nothing in production still points at it. To keep the template but stop using it, leave it in place and don't reference it — deleting is for when you want it gone.

Errors

A template belonging to another team answers 404, by id or alias. A Sending access key gets 403. See Errors.

Transactional email on your own domain.