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

# Manage Pinned Lists

> 리스트 고정 및 해제

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <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>;
};

이 가이드는 리스트를 고정하고 고정 해제하는 방법을 안내합니다.

<Note>
  **사전 준비 사항**

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

  * 승인이 완료된 App이 연결된 [개발자 계정](https://developer.x.com/en/portal/petition/essential/basic-info)
  * 사용자 액세스 토큰(OAuth 1.0a 또는 OAuth 2.0 PKCE)
</Note>

***

<div id="pin-a-list">
  ## 리스트 고정하기
</div>

<Steps>
  <Step title="사용자 ID와 리스트 ID 가져오기">
    인증된 사용자 ID와 고정하려는 리스트의 ID가 필요합니다. 리스트 페이지의 URL에서 리스트 ID를 확인할 수 있습니다.
  </Step>

  <Step title="리스트 고정하기">
    <CodeGroup dropdown>
      ```bash cURL theme={null}
      curl -X POST "https://api.x.com/2/users/2244994945/pinned_lists" \
        -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{"list_id": "1454155907651158017"}'
      ```

      ```python Python SDK 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)

      # 리스트 고정하기
      response = client.lists.pin(
          user_id="2244994945",
          list_id="1454155907651158017"
      )

      print(f"Pinned: {response.data.pinned}")
      ```

      ```javascript JavaScript SDK 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 });

      // 리스트 고정하기
      const response = await client.lists.pin("2244994945", {
        listId: "1454155907651158017",
      });

      console.log(`Pinned: ${response.data?.pinned}`);
      ```
    </CodeGroup>
  </Step>

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

***

<div id="unpin-a-list">
  ## 리스트 고정 해제
</div>

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

  ```python Python SDK 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)

  # 리스트 고정 해제
  response = client.lists.unpin(
      user_id="2244994945",
      list_id="1454155907651158017"
  )

  print(f"Pinned: {response.data.pinned}")
  ```

  ```javascript JavaScript SDK 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 });

  // 리스트 고정 해제
  const response = await client.lists.unpin("2244994945", "1454155907651158017");

  console.log(`Pinned: ${response.data?.pinned}`);
  ```
</CodeGroup>

**응답:**

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

***

<div id="important-notes">
  ## 중요 사항
</div>

<Note>
  * 팔로우 중이거나 소유한 리스트만 고정할 수 있습니다.
  * 고정된 리스트는 X 앱의 내 리스트 상단에 표시됩니다.
  * 고정할 수 있는 리스트의 개수에는 제한이 있습니다.
</Note>

***

<div id="next-steps">
  ## 다음 단계
</div>

<CardGroup cols={2}>
  <Card title="고정 리스트 조회" icon="thumbtack" href="/ko/x-api/lists/pinned-lists/quickstart/pinned-list-lookup">
    내 고정 리스트 가져오기
  </Card>

  <Card title="리스트 조회" icon="list" href="/ko/x-api/lists/list-lookup/quickstart">
    리스트 세부 정보 가져오기
  </Card>

  <Card title="API 참조 문서" icon="code" href="/ko/x-api/lists/pin-list">
    엔드포인트 전체 문서 보기
  </Card>
</CardGroup>
