> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Blocks

> Blocks 엔드포인트를 사용하면 인증된 사용자가 차단한 사용자 목록을 조회할 수 있습니다. Blocks를 다루는 X API v2 standard 티어 레퍼런스입니다.

export const Button = ({href, children}) => {
  return <div className="not-prose">
    <a href={href}>
      <button className="x-btn">
        <span>{children}</span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

Blocks 엔드포인트를 사용하면 인증된 사용자가 차단한 사용자 목록을 조회할 수 있으며, 사용자를 차단하거나 차단 해제할 수 있습니다.

<Callout icon="/icons/xds/icon-key.svg" color="#22C55E" iconType="regular">
  사용자를 차단 및 차단 해제하는 엔드포인트는 Enterprise 플랜에서만 사용할 수 있습니다. Enterprise 관심 양식은 [여기](/forms/enterprise-api-interest)에서 작성할 수 있습니다.
</Callout>

## 개요

<CardGroup cols={2}>
  <Card title="차단된 사용자" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-bulleted-list.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=b9bf8323233df59c682b0fec8e3f88d5" width="24" height="24" data-path="icons/xds/icon-bulleted-list.svg">
    차단된 사용자 목록 가져오기
  </Card>

  <Card title="차단" icon="https://mintcdn.com/x-preview/Vn2KEkZaPF9LiPi3/icons/xds/icon-block.svg?fit=max&auto=format&n=Vn2KEkZaPF9LiPi3&q=85&s=702a65b4001948aebcc42635b8e2eac7" width="24" height="24" data-path="icons/xds/icon-block.svg">
    사용자 차단하기
  </Card>

  <Card title="차단 해제" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-checkmark-circle.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=bd3e78cd745fde73a934535acacaff59" width="24" height="24" data-path="icons/xds/icon-checkmark-circle.svg">
    사용자 차단 해제하기
  </Card>
</CardGroup>

***

## 엔드포인트

| Method | Endpoint                                             | Description  | Availability                                                                                                                                                                    |
| :----- | :--------------------------------------------------- | :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| GET    | [`/2/users/:id/blocking`](/x-api/users/get-blocking) | 차단된 사용자 가져오기 | <div className="flex items-center gap-1 flex-nowrap whitespace-nowrap"><Badge color="blue" size="xs">Pay-per-use</Badge><Badge color="green" size="xs">Enterprise</Badge></div> |
| POST   | `/2/users/:id/blocking`                              | 사용자 차단하기     | <Badge color="green" size="xs">Enterprise</Badge>                                                                                                                               |
| DELETE | `/2/users/:source_user_id/blocking/:target_user_id`  | 사용자 차단 해제하기  | <Badge color="green" size="xs">Enterprise</Badge>                                                                                                                               |

***

## 예시: 차단된 사용자 가져오기

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

## 예시: 사용자 차단하기 (Enterprise 전용)

```bash theme={null}
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"}'
```

***

## 시작하기

<Note>
  **사전 요구사항**

  * 승인된 [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * Developer Console 내의 [Project와 App](/resources/fundamentals/developer-apps)
  * [OAuth 2.0 PKCE](/resources/fundamentals/authentication#oauth-2-0-authorization-code-flow-with-pkce-2)를 통해 얻은 User Access Token
</Note>

<CardGroup cols={2}>
  <Card title="퀵스타트" icon="https://mintcdn.com/x-preview/oR-aRNyj1BKPJtxM/icons/xds/icon-rocket.svg?fit=max&auto=format&n=oR-aRNyj1BKPJtxM&q=85&s=b978d7a9225de31709efbbed5b84e92d" href="/x-api/users/blocks/quickstart" width="24" height="24" data-path="icons/xds/icon-rocket.svg">
    Blocks 시작하기
  </Card>

  <Card title="통합 가이드" icon="https://mintcdn.com/x-preview/Vn2KEkZaPF9LiPi3/icons/xds/icon-book.svg?fit=max&auto=format&n=Vn2KEkZaPF9LiPi3&q=85&s=22ac564792481d14ae36a941546039c8" href="/x-api/users/blocks/integrate" width="24" height="24" data-path="icons/xds/icon-book.svg">
    핵심 개념 및 모범 사례
  </Card>

  <Card title="API 레퍼런스" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-code.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=488e23401b19225b89acc0136d242219" href="/x-api/users/get-blocking" width="24" height="24" data-path="icons/xds/icon-code.svg">
    전체 엔드포인트 문서
  </Card>
</CardGroup>
