Skip to main content

Documentation Index

Fetch the complete documentation index at: https://generaltranslation.mintlify.app/llms.txt

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

The Blocks endpoints let you block and unblock users, and retrieve the list of users blocked by the authenticated user.

Overview

Block

Block a user

Unblock

Unblock a user

Blocked users

Get your blocked user list

Endpoints

MethodEndpointDescription
GET/2/users/:id/blockingGet blocked users
POST/2/users/:id/blockingBlock a user
DELETE/2/users/:source_user_id/blocking/:target_user_idUnblock a user

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

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

Quickstart

Get started with blocks

Integration guide

Key concepts and best practices

API Reference

Full endpoint documentation