Updating Targeting Criteria


PUT accounts/:account_id/targeting_criteria

I see the following issues:

  1. documentation states that account_id is optional. I think this is wrong as the url itself takes it.
  2. documentation states that line_item_id is optional, i was under the impression a targeting criteria must belong to a line item, so this seems wrong as well.
  3. PUT requests are generally to update objects on Twitter, however this endpoint doesn’t take any targeting criteria id to update and kind of creates new ones.

I would also like to know if we just use this endpoint, instead of using the POST one, will it continue adding new targeting criterias or will it update the existing targeting criterias for a line item, provided we pass a line item id?

During my testing this also seems to be wrong:

twurl -H ads-api-sandbox.twitter.com -X PUT -d "line_item_id=cipq&tailored_audiences=qx3a" /0/accounts/gq106g/targeting_criteria | jsonpretty
  "errors": [
      "code": "NOT_FOUND",
      "message": "Targeting Criterion qx3a was not found for Account gq106g"
  "request": {
    "params": {

notice how the request object has no params when they were passed and the error is also wrong as that tailored audience does exist.

Would like some help with all this.


After trying out a lot of things. I have found that the PUT (update) endpoint for targeting criteria doesn’t work with tailored_audience but does work for all other criteria.

Can someone from twitter propose a solution in this regard?

cc @andrs


@tal_asad: that endpoint does work with tailored audiences. I think it doesn’t work for you because you’re in the sandbox environment, and there are some things that don’t work in sandbox - this might be one of them.


Hmm since we are on dev level at the moment can you confirm this because i am kind of at cross roads at the moment. And we are not allowed to create any campaigns on a live account.


Yes, I can confirm that the targeting on a line item can contain, apart from geographical location(s), tailored_audiences with or without any other targeting criteria. I have a live product that uses this, so it’s tested and working. :slightly_smiling: