> ## 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.

# List Members

> List Members エンドポイントを使うと、List のメンバーの表示、List へのメンバー追加、削除などができます。X API v2 スタンダード階層の list members に関するリファレンスドキュメントです。

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>;
};

List Members エンドポイントを使うと、List のメンバーの表示、List へのメンバー追加、削除ができます。また、あるユーザーが所属している List も確認できます。

## 概要

<CardGroup cols={2}>
  <Card title="メンバーを表示" icon="https://mintcdn.com/x-preview/SxzTbJaLjs3MidH1/icons/xds/icon-people.svg?fit=max&auto=format&n=SxzTbJaLjs3MidH1&q=85&s=9d5f3f82edcd2a4070364193436e7980" width="24" height="24" data-path="icons/xds/icon-people.svg">
    List のすべてのメンバーを取得
  </Card>

  <Card title="メンバーを追加" icon="user-plus">
    List にユーザーを追加
  </Card>

  <Card title="メンバーを削除" icon="user-minus">
    List からユーザーを削除
  </Card>

  <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">
    ユーザーが所属する List を確認
  </Card>
</CardGroup>

***

## エンドポイント

### List members lookup

| Method | Endpoint                                                             | Description        |
| :----- | :------------------------------------------------------------------- | :----------------- |
| GET    | [`/2/lists/:id/members`](/x-api/lists/get-list-members)              | List のメンバーを取得      |
| GET    | [`/2/users/:id/list_memberships`](/x-api/users/get-list-memberships) | ユーザーが所属する List を取得 |

### Manage List members

| Method | Endpoint                                                           | Description |
| :----- | :----------------------------------------------------------------- | :---------- |
| POST   | [`/2/lists/:id/members`](/x-api/lists/add-list-member)             | メンバーを追加     |
| DELETE | [`/2/lists/:id/members/:user_id`](/x-api/lists/remove-list-member) | メンバーを削除     |

***

## 例: List のメンバーを取得

```bash theme={null}
curl "https://api.x.com/2/lists/1234567890/members?\
user.fields=username,verified" \
  -H "Authorization: Bearer $BEARER_TOKEN"
```

## 例: メンバーを追加

```bash theme={null}
curl -X POST "https://api.x.com/2/lists/1234567890/members" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "9876543210"}'
```

***

## はじめに

<Note>
  **前提条件**

  * 承認済みの [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * Developer Console 内の [Project と App](/resources/fundamentals/developer-apps)
  * App の[キーとトークン](/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="Lookup クイックスタート" icon="https://mintcdn.com/x-preview/SxzTbJaLjs3MidH1/icons/xds/icon-people.svg?fit=max&auto=format&n=SxzTbJaLjs3MidH1&q=85&s=9d5f3f82edcd2a4070364193436e7980" href="/x-api/lists/list-members/quickstart/list-members-lookup" width="24" height="24" data-path="icons/xds/icon-people.svg">
    List のメンバーを取得
  </Card>

  <Card title="管理クイックスタート" icon="user-plus" href="/x-api/lists/list-members/quickstart/manage-list-members">
    メンバーの追加・削除
  </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/lists/list-members/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/lists/get-list-members" width="24" height="24" data-path="icons/xds/icon-code.svg">
    エンドポイントの詳細ドキュメント
  </Card>
</CardGroup>
