Delete a template

Delete a template and all of its versions.

Deletes the template permanently — there is no undo. Sends that reference the deleted template id are rejected with 404 (template not found).

DELETE /v3/templates/{id}

Responses

StatusDescription
200Deleted. { message: "Template deleted" }.
401Missing or invalid API key.
404No template with this id on your account.

Code examples

cURL
curl -X DELETE https://api.wemail.io/v3/templates/{id} \
  -H "Authorization: Bearer afn_live_…"
Node.js
const res = await fetch("https://api.wemail.io/v3/templates/{id}", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
  },
});
const data = await res.json();
Python
import os, requests

r = requests.delete(
    "https://api.wemail.io/v3/templates/{id}",
    headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
)
data = r.json()