# X authentication

> To be able to create a connection, you need to have a X account with the following credentials:

## Prerequisites

To be able to create a connection, you need to have a X account with the following credentials:

* a **Username or email** address associated with your account
* a **Password** to your account

## Add the X connection

To create a connection to your X instance, you need to perform the following steps:

1. Select Orchestrator from the product launcher.
2. Select a folder, and then navigate to the **Connections** tab.
3. Select **Add connection**.
4. To open the connection creation page, select the connector from the list. You can use the search bar to find the connector.
5. Provide your username or your email address and your password.

   For any secret-type field, you can select the menu next to the field and choose **Use credential asset** to reference an Orchestrator credential asset linked to an external vault instead of entering the value directly. For more information, see [Use credential assets for connections](credential-store-connections.md).
6. Select **Authorize app**. With access to your X account, **UiPath for X** can do the following:
   * See tweets from your timeline (including protected tweets) as well as your lists and collections.
   * See your X profile information and account settings.
   * See accounts you follow, mute, and block.
   * Follow and unfollow accounts for you.
   * Update your profile and account settings.
   * Post and delete tweets for you, and engage with tweets posted by others (like, un-like, or reply to a tweet, retweet, etc.)
     for you.
   * Create, manage, and delete lists and collections for you.
   * Mute, block, and report accounts for you.
   * Send direct messages for you and read, manage, and delete your direct messages.
   * See your email address.
7. Your connection has been added.

For more information on authenticating with X, refer to [X documentation](https://developer.twitter.com/en/docs/authentication/overview).

In case you want to create a private app and use the BYOA authentication, follow these steps:

1. On the authentication page, select the authentication type: **Bring your own OAuth 2.0 app**.![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-348351-f6207654.webp)
2. Provide your private OAuth2 app’s Client ID and Client secret and select **Connect**.

   For any secret-type field, you can select the menu next to the field and choose **Use credential asset** to reference an Orchestrator credential asset linked to an external vault instead of entering the value directly. For more information, see [Use credential assets for connections](credential-store-connections.md).
3. Follow steps 5-7 from the previous tutorial to add the X connection.

:::note
For creating a private OAuth app, follow the steps mentioned in the X documentation i.e. [X developer Apps overview](https://developer.twitter.com/en/docs/apps/overview).
:::

:::note
When registering your OAuth application in X (Twitter), make sure to set the [callback URL](connections#callback-url) to the value displayed on the connection creation page, for example `https://cloud.uipath.com/provisioning_/callback` for Automation Cloud.
:::

## Scopes and permissions

You can use the connection to enable the **X activities** in [UiPath Studio](https://docs.uipath.com/studio) to build automations for tweeting or retrieving tweet, user info. The various permission-based use cases that can be achieved
are as follows:

| **Scope/Permission** | **Usecase** | **Activity/Event** |
| --- | --- | --- |
| tweet.read | Retrieve or search tweets mentioning a particular hashtag or keyword or user or list all the tweets of a user | Search Tweets  List All User Tweets  List All User Mentions  List All Users that Liked  List All Users that Retweeted  List All Followers  List All Following |
| tweet.write | Send or retweet a tweet for online campaigns, notifications of events or conducting poll | Send Tweet  Retweet Tweet |
| users.read | Retrieve or search users that interacted with a tweet by say, retweeting it. Also, retrieving the user info based on username | Search Tweets  List All Users that Retweeted  List All Users that Liked  Get User by Username  List All User Mentions  List All Followers  List All Following |
| like.read | Perform sentiment analysis by retrieving all the users that liked a tweet | List All Users that Liked |
| follows.read | Retrieve the list of followers or following of a user | List All Followers  List All Following |
| list.read | Retrieve all the users that are part of a list owned by the user or retrieve the owned/followed lists of the user | List All Records → Lists members  List All Records → Users owned lists  List All Records → Users followed lists |
