Connect Power Automate to Twitter using a Bring Your Own App approach

*** On July 29 the MS docs now say:

The default shared application (Twitter Client application maintained by Microsoft) is no longer available. The connector now supports only one authentication type – Bring your own application. As of June 2023, it requires a paid Enterprise tier application. However, Twitter’s pricing policy might continue to change.

https://learn.microsoft.com/en-us/connectors/twitter/

Twitter or X as it is now, costs are here:

https://developer.twitter.com/en

Enterprise plans will cost >$5,000 per month!


**** On July 19 2023 this configuration starting reporting errors and now no longer seems to work either!

As I have detailed previously:

Power Automate Twitter connector failing

I needed to regenerate the connection to Twitter in my Flows. The following is what worked for me and I hope it can help you as I didn’t find this set out clearly anywhere else. I found that you needed to create all new Twitter connections in your Flows, so remember to record how these are configured before you go and delete anything.

Step 1. Remove any existing Twitter connections in your Data

image

Navigate to Power Automate and select Data and then Connections from the menu on the left. In the top right of this screen you will find a Search box. Into this search box type:

Twitter

image

You should now see a list of all your existing Twitter connections. ALL of these will need to be removed and thus prior, ensure you have recorded what your Twitter actions do in your Flows, because once you delete the connection here you will NOT be able to see what the actions actually did. They will simply show as invalid.

image

The reason you need to delete ALL the Twitter connections you find is the above error:

Failed to create connection for connection id ‘/providers/MicrosoftPowerApps/apps/shared_twitter/connections/shared-twitter-<guid>’. You have reached the maximum number of connections for the ‘twitter’ API.

I personally found I actually had two connectors. Both years apart, but all must be removed as Twitter now only supports one connection for free.

Step 2. Create Twitter API credentials

Microsoft does provide documentation on this here:

Authentication and Bring your own application

and to start with ensure you are logged into your Twitter account in the browser and navigate to:

https://developer.twitter.com/

image

Select Developer Portal in the top right as shown above.

image

Select the option to Sign up for a Free Account towards the bottom of he page.

image

You’ll then need to write a 250 character or more essay and agree to to all the Terms and Conditions before you Submit.

image

Now select the COG under the default project name that has been created for you as shown above.

image

Select the Edit button as shown above.

image

Select the Delete App button at the bottom of the page. I found that the default app did not have the correct permissions and access so I removed it and created a new one with the right settings.

image

Make sure copy the name of the app because you’ll need to enter at the next dialog before pressing Delete app.

image

Back in the projects dashboard select Add an App as shown above.

image

Give the app a meaningful name select Next at the bottom of the page.

image

Copy the API Key and API Key Secret for later use. Make sure you DO SAVE both the API Key and API Key Secret as they’ll be needed back in Power Automate.Also, keep both of these secure as they control access to your Twitter account.

Select App settings at the bottom of the page to continue.

image

Select the Set up button under the User authentication settings towards the bottom of the page as shown above

image

Ensure:

App permissions = Read and write and Direct message

Type of App = Web App, Automated App or Bot

Call Back URI / Redirect URI = https://global.consent.azure-apim.net/redirect

Website URL = https://global.consent.azure-apim.net/redirect

image

Select he option to Save at the bottom of the page. Select Yes when the above dialog appears to confirm.

image

You’ll now see a Client ID and Client Secret as shown above. You won’t need these so simply select Done to continue. You can re-create them if needed later.

image

Select Yes, I saved it to continue.

Step 3. Reconnect Twitter account in Power Automate

Return to Power Automate, Data, Connectors

image

Select New connection from the top of the page as shown above.

image

Search for Twitter using the Search box in the upper right. Then select the Twitter connector to configure it.

image

Ensure:

Authentication type = Bring your own application

Consumer key = API Key

Consumer secret = API Key Secret

image

A browser pop up will now appear asking you to authorize access to your Twitter account. You’ll need to login here with your Twitter account details. Enter you login details and select Authorize app.

You should then see a confirmation appear in this dialog and the browser pop up window will now close.

image

In the list of connections should now appear an entry for Twitter as shown above, and it it should show as Connected.

image

If you now navigate to where the Twitter action is inside your Flows you should see that the existing one is invalid as shown above.

image

Select the ellipse in the top right hand corner and from the menu that appears select Delete. I found I had to minimise the Twitter action first to allow it to be deleted.

You can now create a new Twitter action which will use the new connector and API that was created.

With that all done you should now Save your Flow and test it to ensure it is working as expected.

In summary, you’ll firstly need to check the existing configuration for any Twitter actions you have in a Flow and record these. Next, you’ll need to remove any and all existing Twitter connections in Power Automate. Remember, there maybe more than one. Next, you’ll need to go Developer area in Twitter. There you’ll need to delete the default app that is created and create a new one. When you create a new one you’ll receive credentials you’ll need to save and use back in Power Automate. Once created you’ll need to configure it with a few additional settings. With that complete, you’ll return to Power Automate and create a new Twitter data connection with the credentials obtained. Finally, you’ll need to remove the old Twitter actions from your Flows and create new ones.

As I said, this process worked for me and I hope it does for you.

30 thoughts on “Connect Power Automate to Twitter using a Bring Your Own App approach

  1. Thanks for the post!

    I’m having an issue getting this to work, and I’m curious – is this *STILL* working for you? It hasn’t been long since you posted this, but I get errors about needing to request “elevated access” in my Twitter developer account, which doesn’t seem to actually exist.

    Like

    1. That is a Forbidden error which means the connection to Twitter is not correct. I suggest you re check your config. Ensure you delete the default app and create a new one when you configure Twitter

      Like

      1. I deleted all apps from Twitter Dev, create a Standalone App set Oauth 1 for read, write and dm, and Oauth 2 as Web app and set callback url and website to https://global.consent.azure-apim.net/redirect. I can create the Twitter Connection in Power Automate (using api key and secret)- no problem all seems to work well. But when I try to run “Post a Tweet” action, I get the following 403 error:

        You currently have access to Twitter API v2 endpoints and limited v1.1 endpoints only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve
        clientRequestId: 3419f90a-cee0-4347-889a-f09b103053c9
        serviceRequestId: 42a054fec5df8c29a9e20c831cd750f0af244ee45975562a9819a8d85bf8d5e5

        Like

      2. I can’t anything further apart from what is in my blog post which is working for me. It is an issue with Twitter not Power Automate. Sorry, all I can suggest is you double check all your settings, especially that you are using the right API key and are not exceeding the Twitter API rate limit.

        Like

      3. Yes it’s odd. I think they have changed something very recently. I setup a new Dev account from scratch and then used those api keys in power automate (as this still allows you to log on to your twitter account), and that doesn’t work either. Are you using a Free account when you are posting or are you paying for twitter api?

        Like

      4. I use the free account exactly per the blog post. Have since I wrote the post. I use it many times and day with various Flows and have no issues.

        Like

  2. Thank you for your Post.
    But it is not working.
    Iam getting this error:
    You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product
    clientRequestId: 76dceedd-503b-41fe-b679-402e697f42f3
    serviceRequestId: df4e7dd2461a159be75e8c4f2aa878568677460a660e2f83bf68e6179bc39eae

    Like

    1. Ok, all my Twitter flows stopped working on the 19th July, so something at Twitter has changed again. Painful and wonder whether it is really worth continuing with this? I’m kinda think no.

      Like

    1. From the docs – as note previously you gotta pay Twitter or X now –

      The default shared application (Twitter Client application maintained by Microsoft) is no longer available. The connector now supports only one authentication type – Bring your own application. As of June 2023, it requires a paid Enterprise tier application. However, Twitter’s pricing policy might continue to change.

      Like

      1. I gave up on Twitter posting with PowerAutomate due to the high cost of distribution, so I signed up for IFTTT pro (3.99 USD/month) 200/day x 30 = 6000 distributions.

        Like

  3. Need guidance on coming error while creating the twitter flow on power automate it’s flow breaks down on error showing
    “You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product
    clientRequestId: xyz
    serviceRequestId: abc”

    Like

    1. *** On July 29 the MS docs now say:

      The default shared application (Twitter Client application maintained by Microsoft) is no longer available. The connector now supports only one authentication type – Bring your own application. As of June 2023, it requires a paid Enterprise tier application. However, Twitter’s pricing policy might continue to change.

      https://learn.microsoft.com/en-us/connectors/twitter/

      Twitter or X as it is now, costs are here:

      https://developer.twitter.com/en

      Enterprise plans will cost >$5,000 per month!

      Like

  4. I managed successful connect to the twitter, but part of my flow is to upload an picture (my post is about announcing a winner from my daily NFT draws). Here is the error I’m getting:

    You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level.

    Can you help?

    Like

    1. *** On July 29 the MS docs now say:

      The default shared application (Twitter Client application maintained by Microsoft) is no longer available. The connector now supports only one authentication type – Bring your own application. As of June 2023, it requires a paid Enterprise tier application. However, Twitter’s pricing policy might continue to change.

      https://learn.microsoft.com/en-us/connectors/twitter/

      Twitter or X as it is now, costs are here:

      https://developer.twitter.com/en

      Enterprise plans will cost >$5,000 per month!

      Like

  5. Really useful post.
    I recreated the Default app and yes I am hitting the same issue as everyone else (You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. ) . I tested posting a tweet using the API 2 and Tweepy and no issues at all. To get Tweepy, installed Python from the Windows store ( as this handles the path) and then installed Tweepy via “pip install tweepy”. THis proves my twitter app is correctly set up and the issue is with the connector and Musk!

    So I wonder if we can’t make API 2 calls via the HTTP Request action. Has anyone tried that from a dev perspective rather than long term commercial use.

    Like

Leave a comment