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

# Manage List Members

> 이 가이드는 List에 멤버를 추가하고 제거하는 방법을 안내합니다. 퀵스타트를 다루는 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>;
};

이 가이드는 List에 멤버를 추가하고 제거하는 방법을 안내합니다.

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

  시작하기 전에 다음이 필요합니다:

  * 승인된 App이 포함된 [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * User Access Token (OAuth 1.0a 또는 OAuth 2.0 PKCE)
  * 소유하고 있는 List
</Note>

***

## List에 멤버 추가

<Steps>
  <Step title="List ID와 user ID 가져오기">
    List의 ID와 추가하려는 사용자의 user ID가 필요합니다. [user lookup 엔드포인트](/x-api/users/lookup/introduction)를 사용하여 user ID를 찾을 수 있습니다.
  </Step>

  <Step title="멤버 추가">
    <CodeGroup dropdown>
      ```bash cURL theme={null}
      curl -X POST "https://api.x.com/2/lists/1441162269824405510/members" \
        -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{"user_id": "2244994945"}'
      ```

      ```python title="Python SDK" lines wrap icon="python" theme={null}
      from xdk import Client
      from xdk.oauth1_auth import OAuth1

      oauth1 = OAuth1(
          api_key="YOUR_API_KEY",
          api_secret="YOUR_API_SECRET",
          access_token="YOUR_ACCESS_TOKEN",
          access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
      )

      client = Client(auth=oauth1)

      # List에 멤버 추가
      response = client.lists.add_member(
          list_id="1441162269824405510",
          user_id="2244994945"
      )

      print(f"Is member: {response.data.is_member}")
      ```

      ```javascript title="JavaScript SDK" lines wrap icon="square-js" theme={null}
      import { Client, OAuth1 } from "@xdevplatform/xdk";

      const oauth1 = new OAuth1({
        apiKey: "YOUR_API_KEY",
        apiSecret: "YOUR_API_SECRET",
        accessToken: "YOUR_ACCESS_TOKEN",
        accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
      });

      const client = new Client({ oauth1 });

      // List에 멤버 추가
      const response = await client.lists.addMember("1441162269824405510", {
        userId: "2244994945",
      });

      console.log(`Is member: ${response.data?.is_member}`);
      ```
    </CodeGroup>
  </Step>

  <Step title="응답 확인">
    ```json theme={null}
    {
      "data": {
        "is_member": true
      }
    }
    ```
  </Step>
</Steps>

***

## List에서 멤버 제거

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.x.com/2/lists/1441162269824405510/members/2244994945" \
    -H "Authorization: Bearer $USER_ACCESS_TOKEN"
  ```

  ```python title="Python SDK" lines wrap icon="python" theme={null}
  from xdk import Client
  from xdk.oauth1_auth import OAuth1

  oauth1 = OAuth1(
      api_key="YOUR_API_KEY",
      api_secret="YOUR_API_SECRET",
      access_token="YOUR_ACCESS_TOKEN",
      access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
  )

  client = Client(auth=oauth1)

  # List에서 멤버 제거
  response = client.lists.remove_member(
      list_id="1441162269824405510",
      user_id="2244994945"
  )

  print(f"Is member: {response.data.is_member}")
  ```

  ```javascript title="JavaScript SDK" lines wrap icon="square-js" theme={null}
  import { Client, OAuth1 } from "@xdevplatform/xdk";

  const oauth1 = new OAuth1({
    apiKey: "YOUR_API_KEY",
    apiSecret: "YOUR_API_SECRET",
    accessToken: "YOUR_ACCESS_TOKEN",
    accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
  });

  const client = new Client({ oauth1 });

  // List에서 멤버 제거
  const response = await client.lists.removeMember(
    "1441162269824405510",
    "2244994945"
  );

  console.log(`Is member: ${response.data?.is_member}`);
  ```
</CodeGroup>

**응답:**

```json theme={null}
{
  "data": {
    "is_member": false
  }
}
```

***

## 중요 참고사항

<Note>
  * 소유한 List의 멤버만 관리할 수 있습니다
  * 사용자를 List에 추가하는 데 해당 사용자의 허가는 필요하지 않습니다
  * 사용자는 자신이 추가된 공개 List를 확인할 수 있습니다
</Note>

***

## 다음 단계

<CardGroup cols={2}>
  <Card title="List 멤버 조회" 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="List 관리" icon="pen" href="/x-api/lists/manage-lists/quickstart">
    List 생성 및 업데이트
  </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/add-list-member" width="24" height="24" data-path="icons/xds/icon-code.svg">
    전체 엔드포인트 문서
  </Card>
</CardGroup>
