Delete Template
Soft-delete a template. Campaigns that already reference this template continue to use the snapshot taken when they were sent — the delete only prevents new sends from referencing it.
Endpoint
DELETE /templates/:id
Returns: 200 OK
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The template ID |
Response
{
"message": "Template deleted"
}
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X DELETE "https://api.arsel.sa/v1/templates/01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a" \
-H "Authorization: Bearer be_your_api_key"
const templateId = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
const response = await fetch(
`https://api.arsel.sa/v1/templates/${templateId}`,
{
method: "DELETE",
headers: { Authorization: "Bearer be_your_api_key" },
},
);
console.log(await response.json());
import requests
template_id = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a"
response = requests.delete(
f"https://api.arsel.sa/v1/templates/{template_id}",
headers={"Authorization": "Bearer be_your_api_key"},
)
print(response.json())
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var templateId = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
var response = await client.DeleteAsync($"https://api.arsel.sa/v1/templates/{templateId}");
Console.WriteLine(await response.Content.ReadAsStringAsync());
<?php
$templateId = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
$ch = curl_init("https://api.arsel.sa/v1/templates/{$templateId}");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Error Responses
- 404 Not Found
{
"status_code": 404,
"name": "not_found",
"message": "Template not found"
}