Unable to upload content of tailored audience via ton_upload (again)



The logs can be found here:

To reproduce the problem:

  • Create a tailored audience using the apis (we are using https://github.com/twitterdev/twitter-ruby-ads-sdk )
  • Upload a file containing TWITTER_IDS using the Ton-upload.
  • when assigning the file to the tailored audience, we are getting a BadRequest error ( “INVALID_PARAMETER”)

It’s not the first time we noticed that error, it disappeared for a while but now is reappearing…



Sorry for delay in replying here. I was able to repro this issue with latest set of Python SDK code and I’m investigating what’s going on but generally when it doubt we would use ton_upload script with --trace as shown:

ton_upload --trace -m upload -b ta_partner -f ~/list.txt

If that works and SDK does not, I expect it is simply a bug with SDK that needs to be fixed.

If even this is not working and you are blocked from uploading data, definitely please let us know.




Hello John,

I was wondering if you had any updates on that issue? We are using ton_upload.rb as our library and the logs we provided are from the trace. There is a 201 code returned after upload so the TON upload is not what breaks but the step after (assigning the file to the audience).


Hello again,

I wanted to mention that problem disappeared on Friday and reappeared today. Our codebase didn’t change over the weekend.



Hey Alex,

Sorry I was investigating this issue off and on over the past week and I think I know what’s going on but haven’t yet confirmed why this regressed from when the SDK was originally released.

In the meantime, I also found out that the multi-chunk upload limit within the SDK is set at 1MB (so any file bigger than 1MB gets sent to multichunk instead of single chunk) - where it could be up to 64MB instead. If your audiences are < 64MB (I think most of them are) this problem shouldn’t block you anymore after the latest pull request I just submitted gets merged in. I would encourage you to help submit and review pull requests because we are looking for more active contributors to these SDKs.

The multichunk issue causing BadRequest above seems to be that input_file_path sent to tailored_audience_changes includes parameters, if passed the version without parameters it should work fine.