Block and unblock users

Manage blocked users on Whatsapp.

Use Block a User or Unblock a User with the connected account ID and the target user ID.

Subscribe to blocked.new to receive block and unblock changes. Check payload.status for blocked or unblocked. See Configure a webhook.

Block and unblock a user

const { data: blocked } = await usersApi.blockUser({
  path: { user_id: "user_id", account_id: "acc_123456789" },
});

// Unblock when needed.
const { data: unblocked } = await usersApi.unblockUser({
  path: { user_id: "user_id", account_id: "acc_123456789" },
  body: {},
});
blocked = users_api.block_user("user_id", "acc_123456789")

# Unblock when needed.
unblocked = users_api.unblock_user(
    "user_id", "acc_123456789", {}
)
curl --request POST \
  --url 'https://api.unipile.com/v2/acc_123456789/users/me/block/user_id' \
  --header 'X-API-KEY: YOUR_API_KEY'

# Unblock when needed.
curl --request POST \
  --url 'https://api.unipile.com/v2/acc_123456789/users/me/unblock/user_id' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{}'

Did this page help you?