Uploading hashed twitter ids to specific tailored audience



I’ve successfully created a tailored audience using api. It shows up when I run:
twurl -H ads-api.twitter.com /0/accounts/ID/tailored_audiences

So, my question is - how do I upload a list of hashed twitter ids to this specific tailored audience? Everyone keep talking about using ton_upload script while using this url: /1.1/ton/bucket/ta_partner , however, I’m confused to how the system will know which SPECIFIC tailored audience I will be uploading the file to ?



After re-reading the documentation I realized that the flow is little different:

  1. Upload first
  2. Create TA
  3. Use tailored_audience_changes

However, I encountered another problem:
ruby -KU -rubygems ton_upload --mode upload --bucket ta_partner --file …/test1_hashed_31259.csv
Uploading …/test1_hashed_31259.csv (6 MB) as text/comma-separated-values via TON API
File stored at

So I don’t really know the id that I can use inside “tailored_audience_changes”


#<Net::HTTP ton.twitter.com:443 open=false>>
#<Net::HTTP::Post POST>
#<Net::HTTPBadRequest 400 Bad Request readbody=true>
File stored at {:cache_control=>"no-cache", :connection=>"close", :content_length=>"0", :date=>"Fri, 31 Jul 2015 21:44:11 GMT", :server=>"tsa_b", :set_cookie=>"guest_id=v1%3A143837905132692025; Domain=.twitter.com; Path=/; Expires=Sun, 30-Jul-2017 21:44:11 UTC", :strict_transport_security=>"max-age=631138519", :x_connection_hash=>"087518c2d753ba95e5d667a726f3e437", :x_rate_limit_limit=>"50", :x_rate_limit_remaining=>"46", :x_rate_limit_reset=>"1438379641", :x_response_time=>"111", :x_tsa_request_body_time=>"13978"}
    indent preformatted text by 4 spaces



I have the same problem. Before Friday everything was correct for me but then I started getting 400 errors for single chunk and multi chunk upload.

It would be great to know if something has changed in the implementation or you have some issues in the API.

I didn’t find anything your Twitter account @AdsAPI

Thank you.


I’m getting the same error since Friday as well. Before that everything was working well, but now every upload is returning a 400 Error with no body.


@dreyacosta I created a new post around the 400 error, as it’s not directly related to the topic here: Tailored Audience TON Upload Failing with 400 Error Code


Looks like TON is back to working.

I’ve successfully uploaded the file, here are my next steps:

twurl -H ads-api.twitter.com "/0/accounts/8arnzm/tailored_audience_changes" -d "tailored_audience_id=vlmg&operation=ADD&input_file_path=/1.1/ton/data/ta_partner/501816370/-v4uiqYHSmujSkc"



However, there are couple of issues that I’ve noticed:
1 - running:
twurl -H ads-api.twitter.com /0/accounts/8arnzm/tailored_audiences_changes/vlmg
twurl -H ads-api.twitter.com /0/accounts/8arnzm/tailored_audiences_changes/e0s8
both give out:

{"errors":[{"code":"ROUTE_NOT_FOUND","message":"The requested resource could not be found"}],"request":{"params":{}}}

2 - Inside Audience Manager, the audience “test1” says “Processing”, Last Updated: Updating, Audience Size: Pending.
Is there a problem?

Thank you!



Note that you are calling:


There is a typo on the endpoint you are using ( an extra “s” ), the correct should be:



Leo and Ran from Commun.it


Got it, thank you commun_it !