Skip to main content
POST
/
api
/
chat
/
block
/
:instance
Block/unblock contact
curl --request POST \
  --url https://api.example.com/api/chat/block/:instance \
  --header 'Content-Type: application/json' \
  --header 'token: <token>' \
  --data '
{
  "number": "<string>",
  "block": true
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.ryzeapi.cloud/llms.txt

Use this file to discover all available pages before exploring further.

Auth: TokenAccount or TokenInstanceRate-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.
curl -X POST "https://ryzeapi.cloud/api/chat/block/$Instance_Name" \
  -H "token: $Token_Instance" \
  -H "Content-Type: application/json" \
  -d '{"number": "5511999999999", "block": true}'

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.
curl -X POST "https://ryzeapi.cloud/api/chat/block/$Instance_Name" \
  -H "token: $Token_Instance" \
  -H "Content-Type: application/json" \
  -d '{"number": "5511999999999", "block": false}'

Success response

200 OK
{
  "success": true,
  "message": "Contact blocked successfully",
  "contact_jid": "5511999999999@s.whatsapp.net",
  "blocked_count": 7,
  "blocked": true
}
FieldTypeDescription
contact_jidstringJID of the affected contact.
blockedbooleanFinal state (true blocked, false unblocked).
blocked_countintTotal number of blocked contacts on the account after the operation.

Path parameters

instance
string
required
Instance name.

Headers

token
string
required
TokenAccount or TokenInstance.

Request body

number
string
required
Phone number or JID of the contact. Individual contacts only, does not work with groups.
block
boolean
required
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

HTTPerror.messageWhen
400Invalid request bodyMalformed JSON.
400Number is requiredMissing field.
401Invalid token
404Instance not found
503Instance is not connected to WhatsAppNo active session.