How to Integrate X (Formerly Twitter) with Pabbly Connect Using OAuth 2.0
This guide walks you through setting up X (Formerly Twitter) integration with Pabbly Connect using OAuth 2.0 Authorization Code Flow with PKCE.
Note: X now uses a pay-per-use credit system. There are no fixed monthly plans. You only pay for what you use. Some endpoints like GET /2/users/me work without credits, but posting tweets and reading tweet data require credits.
Step 1: Create an X Developer Account
1. Go to https://developer.x.com
2. Click "Go to Console"
3. Sign in with your X account
4. You will be redirected to the new Developer Console at console.x.com
Step 2: Create an App in the Developer Console
1. In the Developer Console (console.x.com), click "Apps" in the left sidebar
2. Click "Create App"
3. Enter your app name (e.g., "Pabbly Connect Integrations")
4. Your app will be created with a Client ID and Client Secret
Important: Save your Client ID and Client Secret immediately. You will need these for Pabbly Connect.
Step 3: Configure App Authentication Settings
1. In the Apps page, click on your app name
2. Under "OAuth 2.0 Keys", click "Edit settings"
3. Configure the following:
App Permissions:
Select: Read and write and Direct message
(This enables OAuth 1.0a permissions)
Type of App:
Select: Web App, Automated App or Bot (Confidential client)
(This enables OAuth 2.0 authentication)
App Info:
4. Click "Save Changes"
Step 4: Get Your API Keys
1. Go back to your app in the Developer Console
2. Under "OAuth 2.0 Keys", you will see:
Security Tip: Keep your Client Secret safe. Never share it publicly. If compromised, click "Regenerate" to create a new one.
Step 5: Connect X (Formerly Twitter) in Pabbly Connect
1. In Pabbly Connect, create a new workflow
2. Add an action step and search for "X (Formerly Twitter)"
3. Select an action event (e.g., "Get Me", "Create Tweet", etc.)
4. Click "Connect" to set up the connection
5. In the connection popup, enter:
6. Click "Connect With X (Formerly Twitter)"
7. A new window will open asking you to authorize the app on X
8. Click "Authorize app"
9. You will be redirected back to Pabbly Connect with the connection established
Step 6: Test the Connection
1. After connecting, click "Save & Send Test Request"
2. If successful, you will see a response with your account data:
OAuth 2.0 Configuration Details (For Custom App Setup in Pabbly)
If you are configuring OAuth 2.0 manually in Pabbly's app settings, use these values:
Important Notes
1. Access tokens expire every 2 hours. Pabbly automatically refreshes them using the refresh token if "Refresh Access Token on Expiration" is enabled.
2. Only one active connection per X account. Each time you authorize the app, the previous token is invalidated. All workflow steps using X should use the same connection.
3. Credits required for API calls. X uses pay-per-use billing. Some basic endpoints (like GET /2/users/me) work without credits, but most operations (posting tweets, reading tweets) require credits. Purchase credits at console.x.com > Billing > Credits.
4. Scopes explained:
Troubleshooting
API Endpoints Reference
This guide walks you through setting up X (Formerly Twitter) integration with Pabbly Connect using OAuth 2.0 Authorization Code Flow with PKCE.
Note: X now uses a pay-per-use credit system. There are no fixed monthly plans. You only pay for what you use. Some endpoints like GET /2/users/me work without credits, but posting tweets and reading tweet data require credits.
Step 1: Create an X Developer Account
1. Go to https://developer.x.com
2. Click "Go to Console"
3. Sign in with your X account
4. You will be redirected to the new Developer Console at console.x.com
Step 2: Create an App in the Developer Console
1. In the Developer Console (console.x.com), click "Apps" in the left sidebar
2. Click "Create App"
3. Enter your app name (e.g., "Pabbly Connect Integrations")
4. Your app will be created with a Client ID and Client Secret
Important: Save your Client ID and Client Secret immediately. You will need these for Pabbly Connect.
Step 3: Configure App Authentication Settings
1. In the Apps page, click on your app name
2. Under "OAuth 2.0 Keys", click "Edit settings"
3. Configure the following:
App Permissions:
Select: Read and write and Direct message
(This enables OAuth 1.0a permissions)
Type of App:
Select: Web App, Automated App or Bot (Confidential client)
(This enables OAuth 2.0 authentication)
App Info:
- Callback URI / Redirect URL:
https://connect.pabbly.com/callback-url - Website URL: Your website URL (e.g., https://www.pabbly.com/connect)
4. Click "Save Changes"
Step 4: Get Your API Keys
1. Go back to your app in the Developer Console
2. Under "OAuth 2.0 Keys", you will see:
- Client ID — Copy this
- Client Secret — Click "Show" and copy this
Security Tip: Keep your Client Secret safe. Never share it publicly. If compromised, click "Regenerate" to create a new one.
Step 5: Connect X (Formerly Twitter) in Pabbly Connect
1. In Pabbly Connect, create a new workflow
2. Add an action step and search for "X (Formerly Twitter)"
3. Select an action event (e.g., "Get Me", "Create Tweet", etc.)
4. Click "Connect" to set up the connection
5. In the connection popup, enter:
- Client ID: Your OAuth 2.0 Client ID from Step 4
- Client Secret: Your OAuth 2.0 Client Secret from Step 4
6. Click "Connect With X (Formerly Twitter)"
7. A new window will open asking you to authorize the app on X
8. Click "Authorize app"
9. You will be redirected back to Pabbly Connect with the connection established
Step 6: Test the Connection
1. After connecting, click "Save & Send Test Request"
2. If successful, you will see a response with your account data:
- Data Id — Your X account ID
- Data Name — Your display name
- Data Username — Your @username
OAuth 2.0 Configuration Details (For Custom App Setup in Pabbly)
If you are configuring OAuth 2.0 manually in Pabbly's app settings, use these values:
- Auth Type: OAuth 2.0
- Grant Type: Authorization Code with PKCE
- Redirect URL:
https://connect.pabbly.com/callback-url - Authorize URL:
https://x.com/i/oauth2/authorize - Token URL:
https://api.x.com/2/oauth2/token - Refresh Token URL: (Leave blank — same as Token URL)
- Client ID: Your OAuth 2.0 Client ID
- Client Secret: Your OAuth 2.0 Client Secret
- Code Challenge Method: SHA-256
- Scope:
tweet.read tweet.write users.read offline.access - State: (Leave blank — auto-generated by Pabbly)
- Client Authentication: Send as Basic Auth header
- Refresh Access Token on Expiration: Enabled (checked)
Important Notes
1. Access tokens expire every 2 hours. Pabbly automatically refreshes them using the refresh token if "Refresh Access Token on Expiration" is enabled.
2. Only one active connection per X account. Each time you authorize the app, the previous token is invalidated. All workflow steps using X should use the same connection.
3. Credits required for API calls. X uses pay-per-use billing. Some basic endpoints (like GET /2/users/me) work without credits, but most operations (posting tweets, reading tweets) require credits. Purchase credits at console.x.com > Billing > Credits.
4. Scopes explained:
tweet.read— Read tweetstweet.write— Post and delete tweetsusers.read— Read user profile informationoffline.access— Get a refresh token for automatic token renewal
Troubleshooting
- Invalid State error: Leave the State field blank in Pabbly. Do not enter any custom value.
- 401 Unauthorized: Access token expired or old connection. Create a new connection or re-authorize.
- CreditsDepleted: No API credits in your developer account. Buy credits at console.x.com > Billing.
- client-not-enrolled: App not attached to a project. This error is from the old system. New console apps should work automatically.
- unauthorized_client: Missing or wrong Client Secret. Verify Client Secret and ensure Client Authentication is set to "Send as Basic Auth header".
- redirect_uri mismatch: Ensure
https://connect.pabbly.com/callback-urlis set in both X Developer Console and Pabbly.
API Endpoints Reference
- Get User Info: GET
https://api.x.com/2/users/me - Post a Tweet: POST
https://api.x.com/2/tweets - Delete a Tweet: DELETE
https://api.x.com/2/tweets/{id} - Token Exchange: POST
https://api.x.com/2/oauth2/token - Authorization: GET
https://x.com/i/oauth2/authorize
Attachments
-
Screenshot 2023-04-12 at 6.34.23 PM.png190.2 KB · Views: 6,048 -
Screenshot 2023-04-12 at 6.32.20 PM.png80.7 KB · Views: 6,167 -
Screenshot 2023-04-12 at 6.22.07 PM.png223.5 KB · Views: 6,533 -
Screenshot 2023-04-12 at 6.16.09 PM.png263.2 KB · Views: 6,986 -
Screenshot 2023-04-12 at 5.35.04 PM.png244.7 KB · Views: 8,419 -
Screenshot 2023-04-12 at 6.06.00 PM.png236.1 KB · Views: 7,511 -
Screenshot 2023-04-12 at 6.14.15 PM.png277.5 KB · Views: 7,241 -
Screenshot 2023-04-12 at 5.34.24 PM.png482.4 KB · Views: 8,657
Last edited by a moderator:
