# Targeting

The targeting fields a TikTok ad takes on create and boost, behavior ids, and how to change targeting after the ad is live.

Target a TikTok ad by location, age, gender, language, interests and behaviors, on `POST /v1/ads/create`, inside `targeting` on `POST /v1/ads/boost`, and on `PUT /v1/ads/{adId}`.

## Targeting fields

These fields apply on create:

- `countries`, `ageMin`, `ageMax`, `gender`
- `languages` (ISO 639-1; `zh_TW` targets traditional Chinese)
- `interests` (from `GET /v1/ads/interests`)
- `behaviors`
- `regions`, `cities`, `zips`, `metros` (create only: boost and `PUT` ignore them, so target countries there)
- `incomeTier`

`audienceInclude` and `audienceExclude` take the `platformAudienceId` of a processed Custom Audience ([Create an audience](/platforms/tiktok-ads/audiences)).

`targeting.countries` is required on a boost, because the TikTok ad group needs `location_ids`, unless you attach to an existing Smart+ ad group with `adSetId`.

Housing, employment and credit ads (`specialAdCategories`) cannot use ZIP codes, gender, ages under 18, interest keywords, hashtags, Smart Targeting or lookalike audiences ([Run a housing, employment or credit ad](/platforms/tiktok-ads/boost#run-a-housing-employment-or-credit-ad)).

## Behaviors

`behaviors` are TikTok's video and creator interaction categories, from [`GET /v1/ads/targeting/search?dimension=behavior`](/ad-targeting/search-ad-targeting). Ids look like:

- `video:1913101`: people who watched to the end, liked, commented on or shared videos in that category in the last 15 days.
- `creator:24001`: people who followed or viewed the profile of creators in that category.

TikTok only accepts behaviors with the TikTok placement. When `behaviors` is set, the ad group runs on TikTok alone.

## Change targeting after creation

`PUT /v1/ads/{adId}` accepts `targeting` for TikTok ads and updates the ad group. `regions`, `cities`, `zips` and `metros` are not applied here.

```bash
curl -X PUT "https://zernio.com/api/v1/ads/66f0a1b2c3d4e5f6a7b8c9d0" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "targeting": { "countries": ["US", "CA"], "ageMin": 25 } }'
```

It is a partial update: languages, interest keywords, devices and behaviors you do not send are preserved. Location is the exception: sending a location replaces both the location and the zip targeting.

## If it fails

| Error | Cause | Fix |
|---|---|---|
| `422` with code `invalid_field_value` on `targeting.countries` | No country on a boost | Send at least one country. |
| Audience not applied | The Custom Audience is still processing, which takes up to 48 hours | Wait until it is processed, then pass its `platformAudienceId`. |
| Ad runs only on TikTok | `behaviors` is set, and TikTok accepts behaviors only with the TikTok placement | Drop `behaviors` to deliver beyond the TikTok placement. |

## Related

- [Create a campaign](/platforms/tiktok-ads/create-ads): the create these fields go on.
- [Create an audience](/platforms/tiktok-ads/audiences): the Custom Audiences `audienceInclude` takes.
- [Search ad targeting](/ad-targeting/search-ad-targeting): behavior and interest ids.
- [Update ad](/ad-campaigns/update-ad): every field of `PUT /v1/ads/{adId}`.