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

# Pinned Lists の概要

> pinned Lists エンドポイントを使うと、ユーザーのピン留めした List をルックアップし、どの List をピン留めするかを管理できます。X API v2 スタンダード階層の quickstart に関するリファレンスドキュメントです。

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

pinned Lists エンドポイントを使うと、ユーザーのピン留めした List をルックアップし、どの List をピン留めするかを管理できます。

<Note>
  **前提条件**

  始める前に、以下が必要です:

  * 承認済みの App がある [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * ユーザー Access Token (OAuth 1.0a または OAuth 2.0 PKCE)
</Note>

***

## 利用可能なエンドポイント

<CardGroup cols={2}>
  <Card title="Pinned Lists lookup" icon="thumbtack" href="/x-api/lists/pinned-lists/quickstart/pinned-list-lookup">
    ピン留めした List を取得
  </Card>

  <Card title="Manage pinned Lists" icon="pin" href="/x-api/lists/pinned-lists/quickstart/manage-pinned-lists">
    List のピン留め・解除
  </Card>
</CardGroup>

***

## 認証

| 操作                  | 認証                            |
| :------------------ | :---------------------------- |
| ピン留めした List をルックアップ | OAuth 1.0a または OAuth 2.0 PKCE |
| List のピン留め/解除       | OAuth 1.0a または OAuth 2.0 PKCE |

<Warning>
  ルックアップと管理のどちらの操作もユーザーコンテキスト認証が必要です。App-only (Bearer Token) 認証はサポートされていません。
</Warning>

***

## クイックサンプル

<CodeGroup dropdown>
  ```bash cURL theme={null}
  # ピン留めした List を取得
  curl "https://api.x.com/2/users/2244994945/pinned_lists" \
    -H "Authorization: Bearer $USER_ACCESS_TOKEN"
  ```

  ```python Python SDK theme={null}
  from xdk import Client

  client = Client(bearer_token="YOUR_USER_ACCESS_TOKEN")

  # ピン留めした List を取得
  response = client.lists.get_pinned("2244994945")

  for lst in response.data:
      print(f"{lst.name}")
  ```

  ```javascript JavaScript SDK theme={null}
  import { Client } from "@xdevplatform/xdk";

  const client = new Client({ accessToken: "YOUR_USER_ACCESS_TOKEN" });

  // ピン留めした List を取得
  const response = await client.lists.getPinned("2244994945");

  response.data?.forEach((lst) => {
    console.log(lst.name);
  });
  ```
</CodeGroup>

***

## 次のステップ

<CardGroup cols={2}>
  <Card title="List lookup" icon="https://mintcdn.com/x-preview/ygI6sSJPehlc0qNT/icons/xds/icon-bulleted-list.svg?fit=max&auto=format&n=ygI6sSJPehlc0qNT&q=85&s=b9bf8323233df59c682b0fec8e3f88d5" href="/x-api/lists/list-lookup/quickstart" width="24" height="24" data-path="icons/xds/icon-bulleted-list.svg">
    List の詳細を取得
  </Card>

  <Card title="Manage Lists" icon="pen" href="/x-api/lists/manage-lists/quickstart">
    List の作成と更新
  </Card>
</CardGroup>
