curl -X DELETE https://api2.ecomailapp.cz/lists/1/unsubscribe \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "foo@bar.cz"}'
$listId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/unsubscribe");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'email' => 'foo@bar.cz',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 4,
"list_id": 1,
"email": "foo@bar.cz",
"status": 2,
"subscribed_at": "2024-11-27T11:18:00.000000Z",
"unsubscribed_at": "2024-11-27T11:39:16.000000Z",
"custom_fields": { "mergetag": "content" },
"source": "api"
}
Lists
Unsubscribe subscriber from list
Unsubscribe a subscriber from a specific list.
DELETE
/
lists
/
{list_id}
/
unsubscribe
curl -X DELETE https://api2.ecomailapp.cz/lists/1/unsubscribe \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "foo@bar.cz"}'
$listId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/unsubscribe");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'email' => 'foo@bar.cz',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 4,
"list_id": 1,
"email": "foo@bar.cz",
"status": 2,
"subscribed_at": "2024-11-27T11:18:00.000000Z",
"unsubscribed_at": "2024-11-27T11:39:16.000000Z",
"custom_fields": { "mergetag": "content" },
"source": "api"
}
integer
required
ID of the list.
string
required
Email address of the subscriber to unsubscribe.
curl -X DELETE https://api2.ecomailapp.cz/lists/1/unsubscribe \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "foo@bar.cz"}'
$listId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/lists/{$listId}/unsubscribe");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'email' => 'foo@bar.cz',
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 4,
"list_id": 1,
"email": "foo@bar.cz",
"status": 2,
"subscribed_at": "2024-11-27T11:18:00.000000Z",
"unsubscribed_at": "2024-11-27T11:39:16.000000Z",
"custom_fields": { "mergetag": "content" },
"source": "api"
}
⌘I