User X is not authorized to create tweets for user id Y

api

#1

[Update: I have added some more details about a “non-standard” setup process for this client. Please see at the bottom]

Hi, we have a Twitter app that has been running mostly without issues for a while. Today we’re getting an error for a client account, which seems not to be an issue for other accounts.

Trying to create PromotedOnlyTweets:

POST https://ads-api.twitter.com/1/accounts/18ce54km581/tweet
source=CMP&as_user_id=337853585&tweet_mode=extended&trim_user=true&status=FooBar

We get back:

{"errors":[{"code":"UNAUTHORIZED_ACCESS","message":"User 11673252 is not authorized to create tweets for user id 337853585"}],"request":{"params":{"as_user_id":337853585,"tweet_mode":"extended","account_id":"18ce54km581","trim_user":true,"status":"FooBar"}}}

If I fetch the permissions for this account, we can clearly see that 11673252 has ACCOUNT_ADMIN access to account 18ce54km581:

twurl -t -H ads-api.twitter.com "/1/accounts/18ce54km581/authenticated_user_access"

{
  "data": {
    "user_id": 11673252,
    "permissions": [
      "ACCOUNT_ADMIN"
    ]
  },
  "request": {
    "params": {
      "account_id": "18ce54km581"
    }
  },
  "data_type": "user_access"
}

I have checked various other similar links like https://twittercommunity.com/t/user-xxxx-is-not-authorized-to-create-tweets-for-user-id-yyyyy/73756 and https://twittercommunity.com/t/user-is-not-authorized-to-create-tweets-for-user-id/38982/2 but I believe we’re doing things (passing as_user_id of the target account, and including the target account’s ID in the request URL) correctly on our side.

As I mentioned, this seems to not be an issue for other clients—we can create PromotedOnlyTweets just fine. How can I move forward with this?

UPDATE:

I’m including the email from Twitter support provided to one of our account managers when setting up this account:

Please request your client to grant you Administrator Access to the new Ads account with the word “New” at the end of their new ads account (ID 18ce54km581).
This level of access will allow you to add a payment method and begin creating campaigns on the Ads account.

With your Client’s permission, you can then change your client’s access level to the new Ads account from ‘Account Administrator’ to ‘Ad Manager’. Doing this allows your client to still view the campaign data but they will not have access to your payment method and billing history.

Please note that both accounts (your own and your clients) must have a valid funding source in order for this checkbox to appear. If you have questions about this feature, please write back in and we will continue to help troubleshoot.

I’m still unclear how to proceed with this in terms of the requests and params we need to send in order to create Promoted Tweets on their behalf.


#2

Hi @CMP

When a user ads permission as admin, in order to promote tweets it needs to click on this checkbox too.

CAN COMPOSE PROMOTABLE TWEETS

Regards


#3

@hector_borras This option was already selected.


#4

@CMP: You’ve got the right idea checking the GET accounts/:account_id/authenticated_user_access endpoint. However, as @hector_borras suggestion, you also need the TWEET_COMPOSER permission, which your authenticated user (11673252) does not have.

twurl -H ads-api.twitter.com "/2/accounts/18ce54d4x5t/authenticated_user_access"
{
  "data": {
    "user_id": 2417045708,
    "permissions": [
      "ACCOUNT_ADMIN",
      "TWEET_COMPOSER"
    ]
  },
  "request": {
    "params": {
      "account_id": "18ce54d4x5t"
    }
  }
}

#5

@juanshishido As mentioned earlier, that option was already selected via Twitter’s UI:


#6

Thanks for the additional information, @CMP. The screenshot helps.

It looks like you’re looking at 5l5dht. Could you please check the permissions that 18ce54km581 has granted your authenticated user? When I checked earlier, the TWEET_COMPOSER permission was not enabled for 11673252.


#7

@juanshishido Feel like an idiot now—all this time I’ve been looking at the other account because it has a similar name and the same logo. Indeed, the other account does not have this box ticked. To confirm, this will have to be done by the owner of the account, correct? Because I see that “Can compose promotable Tweets” box disabled to edit it myself.


#8

Not a problem! It’s happened to me lots of times :sweat_smile:

That’s correct. The ads account (or anyone with admin access to the ads account) can modify the permissions. The catch is that you can’t edit access for your own handle—another admin would have to do that.

Thanks again for working through this with us!


#9

Hahaha, No problem!

:grinning: