WhatsApp Cloud API - Block API | Developer Documentation
WhatsApp Cloud API - Block API
Copy for LLM
Version
The Block API allows businesses to manage blocked users on WhatsApp.
Use this API to block users from sending messages to your business number,
retrieve the list of blocked users, and unblock users when needed.
Base
|
|
Endpoints
GET
/{Version}/{Phone-Number-ID}/block_users
Request Syntax
Select language
curl--requestGET\--url'https://graph.facebook.com/{Version}/{Phone-Number-ID}/block_users'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{}'
Select status code
{"Get blocked users": {"value": {"data": [{"messaging_product":"whatsapp","wa_id":"16505551234"}],"paging": {"cursors": {"after":"eyJvZAmZAzZAXQiOjAsInZAlcnNpb25JZACI6IjE3Mzc2Nzk2ODgzODM1ODQifQZDZD","before":"eyJvZAmZAzZAXQiOjAsInZAlcnNpb25JZACI6IjE3Mzc2Nzk2ODgzODM1ODQifQZDZD"}}}}}
Select language
Select status code
Select language
Select status code
Authentication
Scheme
Type
Location
curl--requestGET\--url'https://graph.facebook.com/{Version}/{Phone-Number-ID}/block_users'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{}'
{"Get blocked users": {"value": {"data": [{"messaging_product":"whatsapp","wa_id":"16505551234"}],"paging": {"cursors": {"after":"eyJvZAmZAzZAXQiOjAsInZAlcnNpb25JZACI6IjE3Mzc2Nzk2ODgzODM1ODQifQZDZD","before":"eyJvZAmZAzZAXQiOjAsInZAlcnNpb25JZACI6IjE3Mzc2Nzk2ODgzODM1ODQifQZDZD"}}}}}
POST /{Version}/{Phone-Number-ID}/block_users
Request Syntax
curl--requestPOST \--url'https://graph.facebook.com/{Version}/{Phone-Number-ID}/block_users'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{"block_users": [{"user": "+16505551234"}],"messaging_product": "whatsapp"}'
{"Block user(s)": {"value": {"block_users": {"added_users": [{"input":"+16505551234","wa_id":"16505551234"}]},"messaging_product":"whatsapp"}}}
curl--requestPOST \--url'https://graph.facebook.com/{Version}/{Phone-Number-ID}/block_users'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{"block_users": [{"user": "+16505551234"}],"messaging_product": "whatsapp"}'
{"Block user(s)": {"value": {"block_users": {"added_users": [{"input":"+16505551234","wa_id":"16505551234"}]},"messaging_product":"whatsapp"}}}
DELETE /{Version}/{Phone-Number-ID}/block_users
Request Syntax
curl--requestDELETE \--url'https://graph.facebook.com/{Version}/{Phone-Number-ID}/block_users'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{"block_users": [{"user": "+16505551234"}],"messaging_product": "whatsapp"}'
{"Unblock user(s)": {"value": {"block_users": {"removed_users": [{"input":"+16505551234","wa_id":"16505551234"}]},"messaging_product":"whatsapp"}}}
curl--requestDELETE \--url'https://graph.facebook.com/{Version}/{Phone-Number-ID}/block_users'\--header'Authorization: Bearer <Token>'\--header'Content-Type: application/json'\--data'{"block_users": [{"user": "+16505551234"}],"messaging_product": "whatsapp"}'
{"Unblock user(s)": {"value": {"block_users": {"removed_users": [{"input":"+16505551234","wa_id":"16505551234"}]},"messaging_product":"whatsapp"}}}
Authentication
HTTP Bearer |
Header:
AuthorizationUsage Examples
bearerAuth:
Include
Authorization: Bearer your-token-here in request headersGlobal Authentication Requirements
All endpoints require:
bearerAuth