Remove from blacklist
http
DELETE https://smsprovider-web.vercel.app/api/v1/blacklistRemoves numbers from the blacklist. Re-adding someone who opted out requires their renewed consent by law.
Authentication: Authorization: Bearer bm_live_… · Required scope: lists
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
phones | string[] | yes | items 1–10000 |
Response
200 — MutationResult
Errors
| Status | Code |
|---|---|
| 400 | validation_error |
| 401 | unauthorized |
| 403 | insufficient_scope |
| 429 | rate_limited |
| 500 | internal_error |
Examples
curl
bash
curl -X DELETE "https://smsprovider-web.vercel.app/api/v1/blacklist" \
-H "Authorization: Bearer $BATLER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"phones":["0501234567"]}'Node.js
ts
import { BatlerSMS } from "@batler/sms";
const sms = new BatlerSMS({ apiKey: process.env.BATLER_API_KEY! });
const body = {
"phones": [
"0501234567"
]
};
const result = await sms.blacklist.remove(body.phones);PHP
php
<?php
$ch = curl_init("https://smsprovider-web.vercel.app/api/v1/blacklist");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("BATLER_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["phones" => ["0501234567"]], JSON_UNESCAPED_UNICODE),
]);
$result = json_decode(curl_exec($ch), true);Python
python
import os, uuid, requests
resp = requests.request(
"DELETE", "https://smsprovider-web.vercel.app/api/v1/blacklist",
headers={"Authorization": f"Bearer {os.environ['BATLER_API_KEY']}"},
json={"phones": ["0501234567"]},
timeout=30,
)
resp.raise_for_status()
result = resp.json()C#
csharp
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new("Bearer", Environment.GetEnvironmentVariable("BATLER_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Delete, "https://smsprovider-web.vercel.app/api/v1/blacklist");
req.Content = new StringContent("{\"phones\":[\"0501234567\"]}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();