Block a number or a dial prefix
const url = 'https://app.whatsetter.com/api/v1/blocked-contacts';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kind":"prefix","prefix":"+91","label":"India","reason":"Out of market"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.whatsetter.com/api/v1/blocked-contacts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "prefix", "prefix": "+91", "label": "India", "reason": "Out of market" }'Silences the AI agent for one number (kind: number + phone, any
international format) or a whole dial code (kind: prefix + prefix,
1 to 4 digits, with or without +). Their messages still reach the
inbox; the agent never replies or follows up. Rules are team-wide.
label (≤ 80) and reason (≤ 500) are optional. A workspace holds at
most 500 rules. Requires scope blocklist:manage.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
For kind: number. Any international format, e.g. +33 6 12 34 56 78.
For kind: prefix. 1 to 4 digits, e.g. +91 or 91.
Example
{ "kind": "prefix", "prefix": "+91", "label": "India", "reason": "Out of market"}Responses
Section titled “Responses”The rule
object
object
The bare digits of the number (or a masked WhatsApp id), or the dial code.
E.164 form for kind: number when the value is a real phone; null otherwise.
null = team-wide (every rule created through the API); a campaign slug when the dashboard scoped it.
Example
{ "data": { "id": "68f1a0b1c2d3e4f5a6b7c8da", "kind": "prefix", "value": "91", "phone": null, "label": "India", "reason": "Out of market", "campaign_id": null, "created_at": "2026-09-15T12:01:00.000Z" }}Missing, unknown or revoked API key
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}The key lacks the required scope
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}This number or prefix is already blocked
object
object
Example
{ "error": { "code": "already_blocked", "message": "The +91 prefix is already blocked in this workspace." }}Invalid kind, phone, prefix, label or reason
object
object
Example
{ "error": { "code": "validation_error", "message": "\"prefix\" must be a dial code of 1 to 4 digits, e.g. +91." }}The workspace already holds 500 rules
object
object
Example
{ "error": { "code": "quota_exceeded", "message": "This workspace already has 500 blocked entries. Remove some first." }}
