Good questions. Yes, these two steps can definitely be done at the same time, @majoritasdev. In fact, we encourage the use of the batch endpoints.
$ twurl -A "Content-Type: application/json" -X POST -H ads-api.twitter.com "/3/batch/accounts/18ce54d4x5t/targeting_criteria" -d '[{"operation_type":"Create","params":{"line_item_id":"64ks4","targeting_type":"ENGAGEMENT_TYPE","targeting_value":"IMPRESSION"}}, {"operation_type":"Create","params":{"line_item_id":"64ks4","targeting_type":"USER_ENGAGEMENT","targeting_value":"756201191646691328"}}]'
{
"data": [
{
"line_item_id": "64ks4",
"name": "RETARGETING_ENGAGEMENT_TYPE",
"id": "hzs7ul",
"account_id": "18ce54d4x5t",
"operator_type": "EQ",
"created_at": "2018-03-08T19:20:10Z",
"targeting_value": "IMPRESSION",
"updated_at": "2018-03-08T19:20:10Z",
"deleted": false,
"targeting_type": "ENGAGEMENT_TYPE"
},
{
"line_item_id": "64ks4",
"name": "USER_ENGAGER_RETARGETING",
"id": "hzs7um",
"account_id": "18ce54d4x5t",
"operator_type": "EQ",
"created_at": "2018-03-08T19:20:10Z",
"targeting_value": 756201191646691328,
"updated_at": "2018-03-08T19:20:10Z",
"deleted": false,
"targeting_type": "USER_ENGAGEMENT"
}
],
"request": [
{
"params": {
"line_item_id": "64ks4",
"targeting_type": "ENGAGEMENT_TYPE",
"targeting_value": "IMPRESSION",
"account_id": "18ce54d4x5t"
},
"operation_type": "Create"
},
{
"params": {
"line_item_id": "64ks4",
"targeting_type": "USER_ENGAGEMENT",
"targeting_value": 756201191646691328,
"account_id": "18ce54d4x5t"
},
"operation_type": "Create"
}
]
}
Yes, ad accounts still need the account feature. Trying to add this type of targeting for an ads account that is not whitelisted will results in the following error:
{
"request": [
{
"params": {
"line_item_id": "5t0ac",
"targeting_type": "USER_ENGAGEMENT",
"targeting_value": 2417045708,
"account_id": "18ce54aymz3"
},
"operation_type": "Create"
},
{
"params": {
"line_item_id": "5t0ac",
"targeting_type": "ENGAGEMENT_TYPE",
"targeting_value": "IMPRESSION",
"account_id": "18ce54aymz3"
},
"operation_type": "Create"
}
],
"operation_errors": [
[
{
"code": "INVALID",
"message": "Cannot set USER_ENGAGER_RETARGETING to targeting type field because feature ENGAGER_RETARGETING is not enabled for this account",
"attribute": "targeting_type"
}
],
[]
]
}
Thanks!