# Hermoso: add_x_ads_targeting · Hermoso developer docs

> Machine-readable twin of https://hermoso.ai/docs/reference/ads/add_x_ads_targeting/. Generated from the shipped page. Do not edit by hand.
> Full agent guide: https://hermoso.ai/llms.txt · MCP: https://app.hermoso.ai/mcp

[Docs](https://hermoso.ai/docs/) / [Tool reference](https://hermoso.ai/docs/reference/) / [Ad campaign management](https://hermoso.ai/docs/reference/ads/) / add_x_ads_targeting

# `add_x_ads_targeting`

Target an X ads line item

Area: X ADS CUSTOM AUDIENCES + CONVERSION API · [Ad campaign management](https://hermoso.ai/docs/reference/ads/). Generated from the running MCP server, like the rest of the [tool reference](https://hermoso.ai/docs/reference/).

## Description

Add targeting criteria to an X LINE ITEM. Targeting does NOT attach to a campaign on X — a campaign carries only budget and funding. Pass locationIds resolved with x_ads_geo_search, and/or criteria[] for any of X's other 37 targeting vocabularies when you already hold the ids. X takes ONE criterion per API call, so a set is several calls: each is reported individually, a partial failure NAMES what did not apply, and the line item's FULL targeting is read back afterwards so the answer is what the line item carries rather than what was sent. Adds no spend — the line item stays PAUSED.

## Parameters

Parameter Type Description

`adAccountId` `string` X ad account id (list_x_ads_accounts); omit if only one is shared

`accountId` `string` older name for adAccountId (MCP only)

`lineItemId` required `string` line item id to target, from list_x_ads_line_items

`locationIds` `string[]` opaque ids from x_ads_geo_search

`criteria` `object[]` [{targetingType, targetingValue, operatorType?}] — operatorType defaults to EQ

## Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and `POST https://app.hermoso.ai/v1/tools/add_x_ads_targeting`.

**MCP** (`tools/call`)

`{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"add_x_ads_targeting","arguments":{"lineItemId":"<string>"}}}`
**CLI**

`hermoso call add_x_ads_targeting --json '{"lineItemId":"<string>"}'`

## Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See [Credits & costs](https://hermoso.ai/docs/credits/).

## Related tools

- [x_ads_geo_search](https://hermoso.ai/docs/reference/ads/x_ads_geo_search/) Find X ads location ids
- [create_x_ads_promoted_tweet](https://hermoso.ai/docs/reference/ads/create_x_ads_promoted_tweet/) Attach a post to an X line item (paused)
- [send_x_ads_conversions](https://hermoso.ai/docs/reference/ads/send_x_ads_conversions/) Send conversions to X (Conversion API)
- [x_ads_report](https://hermoso.ai/docs/reference/ads/x_ads_report/) X ads performance report
- [manage_x_ads_conversion_events](https://hermoso.ai/docs/reference/ads/manage_x_ads_conversion_events/) X Pixel conversion events (list / create / update)
- [list_openai_ads_conversion_events](https://hermoso.ai/docs/reference/ads/list_openai_ads_conversion_events/) List ChatGPT Ads conversion events
- [update_x_ads_audience](https://hermoso.ai/docs/reference/ads/update_x_ads_audience/) Change an X custom audience
- [create_openai_ads_pixel](https://hermoso.ai/docs/reference/ads/create_openai_ads_pixel/) Create a ChatGPT Ads pixel
- [create_x_ads_audience](https://hermoso.ai/docs/reference/ads/create_x_ads_audience/) Create an X custom audience
- [create_openai_ads_conversion_event](https://hermoso.ai/docs/reference/ads/create_openai_ads_conversion_event/) Define a ChatGPT Ads conversion

[All 759 Ad campaign management tools](https://hermoso.ai/docs/reference/ads/) · [tools.json](https://hermoso.ai/docs/reference/tools.json)
