Add to Blacklist POST
Adds a mobile number to your account's blacklist. Blacklisted numbers do not receive SMS from this account, starting with the next send.
Authorization
API Key (Authentication) — send the header Authorization: Bearer <API_KEY> (API keys start with smsk_)
HTTP Request
http
POST https://public-api.smsup-plus.com/Blacklist/insertBlacklistContent Type
application/json
Parameter Description
| Property | Type | Required | Description |
|---|---|---|---|
mobile | string | Required | Thai mobile number — 0812345678, +66812345678, 66812345678, with or without spaces / -. It is converted to 66XXXXXXXXX, the same format used by Send SMS |
reason | string | Optional | Reason for blacklisting |
Response Description
| Property | Type | Description |
|---|---|---|
status | number | 200 on success |
data | object | The stored entry — same fields as Blacklist |
data.mobile | string | The number in 66XXXXXXXXX format (the value matched at send time) |
data.source | string | api |
Request Example
bash
curl -X POST 'https://public-api.smsup-plus.com/Blacklist/insertBlacklist' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"mobile": "66812345678",
"reason": "Customer opted out"
}'js
const res = await fetch('https://public-api.smsup-plus.com/Blacklist/insertBlacklist', {
method: 'POST',
headers: { Authorization: 'Bearer <API_KEY>', 'Content-Type': 'application/json' },
body: JSON.stringify({ mobile: '66812345678', reason: 'Customer opted out' }),
})
console.log(await res.json())Response Example
json
{
"status": 200,
"data": {
"accountId": 1024,
"mobile": "66812345678",
"reason": "Customer opted out",
"source": "api",
"createdBy": 2048,
"createdAt": "2026-11-16T03:30:00.123456789Z"
}
}Possible Errors
| HTTP | Response | Cause |
|---|---|---|
| 200 | {"status":400,"description":"mobile is required."} | mobile missing or empty, or body is not JSON |
| 200 | {"status":400,"description":"Invalid mobile number."} | Not a Thai mobile number (after conversion it must be 66 followed by 9 digits) |
| 200 | {"status":500,"description":"Failed to add to blacklist."} | Save failed — retry |
| 401 | {"error":"invalid api key"} | Invalid API key — see Errors |
WARNING
Once authenticated, this endpoint always answers HTTP 200. Check the status field in the body.
Effect on sending SMS
- The blacklist is per account — it only affects SMS sent from your account.
- When you call Send SMS to a blacklisted number, that destination gets
status{"code":"403","name":"REJECTED","description":"Number is blacklisted"}and is not sent. Other destinations in the same request are sent normally. - Messages already accepted but not yet sent (e.g. scheduled ones) are checked again right before sending; if the number is blacklisted by then, it is not sent.
INFO
Duplicates are not checked before saving — check the list first.
