Description
This API allows businesses to block WhatsApp users from contacting them further. Blocking a user prevents them from sending new messages to your WhatsApp Business Account, and your business will also be unable to send messages to the user.
Note:
- You can only block users who have messaged your business in the last 24 hours.
- There is a 64,000 user blocklist limit per WhatsApp Business Account.
cURL Request
curl --location 'https://api.gupshup.io/wa/app/{{appId}}/user/block' \
--header 'apikey: {{apiKey}}' \
--header 'Content-Type: application/json' \
--data '{
"messaging_product": "whatsapp",
"block_users": [
{
"user": "919876543210"
}
]
}'Request Parameters
| Key | Description | Constraints |
|---|---|---|
| Headers | ||
| apikey | Apikey of app | Should be a valid gupshup.io apikey |
| Path Params | ||
| appId | appId of the app | Should be a valid appId |
Response Parameters
| Key | Description | Constraints |
|---|---|---|
| input | Phone number of a WhatsApp user | |
| wa_id | Unique ID of a WhatsApp user |
Status Codes
Status Code | Response | Comments |
|---|---|---|
Success | ||
200 | | |
Error | ||
400 | | |
401 | | When API authentication fails. |
Common Error Codes
| Code | Description |
|---|---|
| 139100 | Failed to block/unblock some users |
| 131047 | Re-engagement required (24-hour rule) |
| 139101 | Blocklist limit reached |
| 130429 | Rate limit hit |
