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

# Twitter v2

> Integrate your application with the Twitter v2 API

## 🚀 Quickstart

Connect to Twitter v2 with Nango and see data flow in 2 minutes.

<Steps>
  <Step title="Create the integration">
    In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Twitter v2*.
  </Step>

  <Step title="Authorize Twitter v2">
    Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then log in to Twitter. Later, you'll let your users do the same directly from your app.
  </Step>

  <Step title="Call the Twitter v2 API">
    Let's make your first request to the Twitter v2 API. Replace the placeholders below with your [secret key](https://app.nango.dev/dev/environment-settings), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl "https://api.nango.dev/proxy/2/users/me" \
          -H "Authorization: Bearer <NANGO-SECRET-KEY>" \
          -H "Provider-Config-Key: <INTEGRATION-ID>" \
          -H "Connection-Id: <CONNECTION-ID>"
        ```
      </Tab>

      <Tab title="Node">
        Install Nango's backend SDK with `npm i @nangohq/node`. Then run:

        ```typescript theme={null}
        import { Nango } from '@nangohq/node';

        const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });

        const res = await nango.get({
            endpoint: '/2/users/me',
            providerConfigKey: '<INTEGRATION-ID>',
            connectionId: '<CONNECTION-ID>'
        });

        console.log(res.data);
        ```
      </Tab>
    </Tabs>

    Or fetch credentials with the [Node SDK](/reference/sdks/node#get-a-connection-with-credentials) or [API](/reference/api/connection/get).

    ✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.
  </Step>

  <Step title="Implement Nango in your app">
    Follow our [Auth implementation guide](/guides/primitives/auth) to integrate Nango in your app.

    To obtain your own production credentials, follow the setup guide linked below.
  </Step>
</Steps>

## 📚 Twitter v2 Integration Guides

Nango maintained guides for common use cases.

* [How to register your own Twitter v2 OAuth app](/api-integrations/twitter-v2/how-to-register-your-own-twitter-v2-api-oauth-app)\
  Register an OAuth app with Twitter and obtain credentials to connect it to Nango

Official docs: [Twitter v2 API docs](https://developer.twitter.com/en/docs/authentication/oauth-2-0/user-access-token)

## 🧩 Pre-built syncs & actions for Twitter v2

Enable them in your dashboard. Extend and customize to fit your needs.

### Others

| Function name        | Description                                               | Type                                           | Source code                                                                                                                   |
| -------------------- | --------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `bookmark-tweet`     | Bookmark a tweet for an authenticated user.               | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/bookmark-tweet.ts)     |
| `create-liked-tweet` | Create a liked tweet in Twitter/X                         | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/create-liked-tweet.ts) |
| `create-list`        | Create a list in Twitter/X                                | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/create-list.ts)        |
| `create-tweet`       | Create a tweet in Twitter/X.                              | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/create-tweet.ts)       |
| `delete-liked-tweet` | Remove a liked tweet (unlike) for the authenticated user. | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/delete-liked-tweet.ts) |
| `delete-list`        | Delete a List owned by the authenticated user             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/delete-list.ts)        |
| `delete-tweet`       | Delete or archive a tweet in Twitter/X                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/delete-tweet.ts)       |
| `follow-user`        | Follow a user from the authenticated account.             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/follow-user.ts)        |
| `get-liked-tweet`    | Retrieve a single liked tweet from Twitter/X by its ID.   | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/get-liked-tweet.ts)    |
| `get-list`           | Retrieve a single list from Twitter/X                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/get-list.ts)           |
| `get-mention`        | Retrieve a single mention from Twitter/X.                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/get-mention.ts)        |
| `get-space`          | Retrieve a single space from Twitter/X                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/get-space.ts)          |
| `get-tweet`          | Retrieve a single tweet from Twitter/X.                   | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/get-tweet.ts)          |
| `get-user`           | Retrieve a single user from Twitter/X                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/get-user.ts)           |
| `like-tweet`         | Like a tweet                                              | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/like-tweet.ts)         |
| `list-liked-tweets`  | List liked tweets from a specific Twitter/X user          | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/list-liked-tweets.ts)  |
| `list-lists`         | List all Lists owned by a specified user from X API       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/list-lists.ts)         |
| `list-mentions`      | List mentions from Twitter/X for a specified user.        | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/list-mentions.ts)      |
| `list-spaces`        | List Spaces from Twitter/X matching a search query        | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/list-spaces.ts)        |
| `list-tweets`        | List tweets from a specific Twitter/X user timeline.      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/list-tweets.ts)        |
| `list-users`         | List users from Twitter/X by IDs or usernames             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/list-users.ts)         |
| `remove-bookmark`    | Remove a tweet bookmark                                   | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/remove-bookmark.ts)    |
| `unfollow-user`      | Unfollow a user from the authenticated account            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/unfollow-user.ts)      |
| `unlike-tweet`       | Unlike a Tweet                                            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/unlike-tweet.ts)       |
| `update-list`        | Update a list in Twitter/X.                               | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/actions/update-list.ts)        |
| `liked-tweets`       | Sync liked tweets from Twitter/X                          | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/syncs/liked-tweets.ts)         |
| `lists`              | Sync lists from Twitter/X.                                | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/syncs/lists.ts)                |
| `mentions`           | Sync mentions from Twitter/X                              | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/syncs/mentions.ts)             |
| `spaces`             | Sync spaces from Twitter/X using the search endpoint      | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/syncs/spaces.ts)               |
| `tweets`             | Sync tweets from Twitter/X user timeline                  | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/syncs/tweets.ts)               |
| `users`              | Sync users from Twitter/X                                 | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/twitter-v2/syncs/users.ts)                |

***
