Skip to main content
The Blocks endpoints let you retrieve the list of users blocked by the authenticated user, as well as block and unblock users.
The block and unblock users endpoints are only available under the Enterprise plan. You can fill out the Enterprise interest form here.

Overview

Blocked users

Get your blocked user list

Block

Block a user

Unblock

Unblock a user

Endpoints

MethodEndpointDescriptionAvailability
GET/2/users/:id/blockingGet blocked users
Pay-per-useEnterprise
POST/2/users/:id/blockingBlock a userEnterprise
DELETE/2/users/:source_user_id/blocking/:target_user_idUnblock a userEnterprise

Example: Get blocked users

curl "https://api.x.com/2/users/123456789/blocking?\
user.fields=username,description" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"

Example: Block a user (Enterprise only)

curl -X POST "https://api.x.com/2/users/123456789/blocking" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"target_user_id": "9876543210"}'

Getting started

Prerequisites