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

# v1 to v2

> If you have been working with the standard v1.1 POST lists/create, POST lists/destroy, and POST. Reference for the Enterprise X API tier covering migrate.

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

### Manage Lists: Standard v1.1 compared to X API v2

If you have been working with the standard v1.1 [POST lists/create](https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-create), [POST lists/destroy](https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy), and [POST lists/update](https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-update) endpoints, the goal of this guide is to help you understand the similarities and differences between the standard v1.1 and X API v2 manage List endpoints.

* **Similarities**
  * Authentication
* **Differences**
  * Endpoint URLs
  * App and Project requirements
  * HTTP methods
  * Rate limits
  * Request parameters

#### Similarities

**Authentication**

Both endpoint versions support [OAuth 1.0a User Context](https://developer.x.com/content/developer-twitter/resources/fundamentals/authentication). Therefore, if you were previously using one of the standard v1.1 manage Lists endpoints, you can continue using the same authentication method if you migrate to the X API v2 version.

#### Differences

**Endpoint URLs**

* Standard v1.1 endpoints:
  * POST [https://api.x.com/1.1/lists/create.json](https://api.x.com/1.1/lists/create.json)
    (Creates a List)
  * POST [https://api.x.com/1.1/lists/destroy.json](https://api.x.com/1.1/lists/destroy.json)
    (Deletes a List)
  * POST [https://api.x.com/1.1/lists/update.json](https://api.x.com/1.1/lists/update.json)
    (Updates a List)
* X API v2 endpoint:
  * POST [https://api.x.com/2/lists](https://api.x.com/2/lists)
    (Creates a List)

  * DELETE [https://api.x.com/2/lists/:id](https://api.x.com/2/lists/:id)
    (Deletes a List)

  * PUT [https://api.x.com/2/lists/:id](https://api.x.com/2/lists/:id)
    (Updates a List)

**Rate limits**

| **Standard v1.1**                       | **X API v2**                                                                           |
| :-------------------------------------- | :------------------------------------------------------------------------------------- |
| /1.1/lists/create.json<br /><br />none  | /2/lists<br /><br />300 requests per 15-minute window with OAuth 1.0a User Context     |
| /1.1/lists/destroy.json<br /><br />none | /2/lists/:id<br /><br />300 requests per 15-minute window with OAuth 1.0a User Context |
| /1.1/lists/update.json<br /><br />none  | /2/lists/:id<br /><br />300 requests per 15-minute window with OAuth 1.0a User Context |

**App and Project requirements**

The X API v2 endpoints require that you use credentials from a [developer App](/resources/fundamentals/developer-apps) associated with a [Project](/resources/fundamentals/developer-apps) when authenticating your requests. All X API v1.1 endpoints can use credentials from Apps or Apps related to a project.

**Request parameters**

The following standard v1.1 request parameters have equivalents in X API v2:

**Create a List**

| **Standard** | **X API v2** |
| :----------- | :----------- |
| name         | name         |
| mode         | private      |
| description  | description  |

**Delete/Update a List**

| **Standard**        | **X API v2**  |
| :------------------ | :------------ |
| owner\_screen\_name | No equivalent |
| owner\_id           | No equivalent |
| list\_id            | id            |
| slug                | No equivalent |

<Note>
  **Please note:** Standard v1.1 parameters are passed as query parameters, whereas the X API v2 parameters are passed as body parameters (for the POST endpoint) or path parameters (for the DELETE and PUT endpoints).
</Note>

***

## Code examples

### Create a List (v2)

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl -X POST "https://api.x.com/2/lists" \
    -H "Authorization: OAuth ..." \
    -H "Content-Type: application/json" \
    -d '{"name": "My List", "description": "A great list"}'
  ```

  ```python Python theme={null}
  # Requires OAuth 1.0a User Context authentication
  import requests
  from requests_oauthlib import OAuth1

  auth = OAuth1(
      "API_KEY", "API_SECRET",
      "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET"
  )

  url = "https://api.x.com/2/lists"
  data = {"name": "My List", "description": "A great list"}

  response = requests.post(url, auth=auth, json=data)
  print(response.json())
  ```

  ```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)

  # Create a List
  response = client.lists.create(name="My List", description="A great list")
  print(f"Created List: {response.data.id}")
  ```

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

  // Create a List
  const response = await client.lists.create({
    name: "My List",
  });
  console.log(`Created List: ${response.data?.id}`);
  ```
</CodeGroup>

### Delete a List (v2)

<CodeGroup dropdown>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.x.com/2/lists/123456789" \
    -H "Authorization: OAuth ..."
  ```

  ```python Python theme={null}
  # Requires OAuth 1.0a User Context authentication
  import requests
  from requests_oauthlib import OAuth1

  auth = OAuth1(
      "API_KEY", "API_SECRET",
      "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET"
  )

  url = "https://api.x.com/2/lists/123456789"
  response = requests.delete(url, auth=auth)
  print(response.json())
  ```

  ```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)

  # Delete a List
  response = client.lists.delete("123456789")
  print(f"Deleted: {response.data.deleted}")
  ```

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

  // Delete a List
  const response = await client.lists.delete("123456789");
  console.log(`Deleted: ${response.data?.deleted}`);
  ```
</CodeGroup>
