Chat
Block/unblock contact
Adds or removes a contact from the blocked list
POST
Block/unblock contact
Auth:
TokenAccount or TokenInstance • Rate-limit: Global (100/min) • Idempotent: yes
Blocks or unblocks a contact. The response includes blocked_count, the total number of blocked contacts on the account after the operation.
Examples
Block
Adds the contact to the blocked list (block: true), stopping message sending and receiving in both directions. Previous history is preserved.
Unblock
Removes the contact from the blocked list (block: false), unblocking message traffic in both directions. The operation syncs automatically with the phone’s app.
Success response
200 OK
| Field | Type | Description |
|---|---|---|
contact_jid | string | JID of the affected contact. |
blocked | boolean | Final state (true blocked, false unblocked). |
blocked_count | int | Total number of blocked contacts on the account after the operation. |
Path parameters
Instance name.
Headers
TokenAccount or TokenInstance.
Request body
Phone number or JID of the contact. Individual contacts only, does not work with groups.
true blocks, false unblocks.Notes
- Blocking stops sending/receiving messages in both directions; previous history remains.
- Syncs with the phone’s app automatically.
- There is no specific webhook event for block/unblock in the current model.
Error responses
| HTTP | error.message | When |
|---|---|---|
| 400 | Invalid request body | Malformed JSON. |
| 400 | Number is required | Missing field. |
| 401 | Invalid token | , |
| 404 | Instance not found | , |
| 503 | Instance is not connected to WhatsApp | No active session. |