delete_x_ads_object
Delete an X ads object (permanent, cascades) destructive
Description
PERMANENTLY delete an X campaign, line item, promoted post, promoted account or targeting criterion — or ARCHIVE a lead form (it stops collecting and its leads can no longer be exported, so run get_x_ads_leads first), or remove a card, a Media Library item (type media: id is the media_key) or a custom audience (custom_audience). X CASCADES AND PUBLISHES NO UNDO: deleting a campaign destroys its line items and their promoted posts too — verified live, the children answer 404 the moment the parent is deleted. RUN IT WITHOUT confirm FIRST: that deletes nothing and reports the REAL blast radius read back off X (what is underneath it, whether it is live, whether it has spent). Show the user exactly that, get an unambiguous yes, then call again with confirm:true — and, for anything with children / live delivery / real spend, also confirmName set to its exact name and confirmChildren set to the real count, because confirm:true alone proves you meant to delete SOMETHING and cannot prove you aimed at the right object. TO STOP DELIVERY WITHOUT DESTROYING ANYTHING use set_x_ads_status PAUSED, which is reversible — except for a promoted post, which cannot be paused on X at all, so pause its LINE ITEM instead. Removing a targeting criterion WIDENS the audience rather than narrowing it. The result is confirmed by re-reading the object, never by X's 200.
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) |
typerequired | "campaign" | "line_item" | "promoted_tweet" | "targeting_criterion" | "promoted_account" | "lead_form" | "card" | "media" | "custom_audience" | kind of object the id names; for media, id is the media_key |
idrequired | string | campaign/line-item id, or the id from list_x_ads_promoted_tweets / list_x_ads_targeting |
lineItemId | string | REQUIRED for type "targeting_criterion" — X cannot look one up without its line item |
confirm | boolean | omit on the first call to see the blast radius |
confirmName | string | the target's exact name — required once it has children, is live, or has spent |
confirmChildren | number | the real number of children, from the unconfirmed call |
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/delete_x_ads_object.
MCP (tools/call)
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"delete_x_ads_object","arguments":{"type":"<one of the listed values>","id":"<string>"}}}
CLI
hermoso call delete_x_ads_object --json '{"type":"<one of the listed values>","id":"<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.
Related tools
get_x_ads_leadsRead the leads from an X lead formset_x_ads_statusPause or activate an X campaign or line itemx_ads_targeting_searchFind X targeting ids (interests, devices, languages…)list_x_ads_funding_instrumentsList X ad account payment methodslist_x_ads_targetingList an X line item’s targetinglist_x_ads_promoted_tweetsList X promoted postsupdate_x_ads_line_itemChange an X line item (ad group)update_x_ads_campaignChange an X campaign budget or settings