# Ads commands

Inspect ads, campaigns, audiences, leads, and conversion destinations with explicit connected-account and ad-account IDs.

Start with read-only ads commands. Creating or updating ads can affect live campaigns and spend, so verify account scope and obtain approval before writes. [Authenticate](/cli/authentication) first.

## First command

List ads without changing campaigns:

```bash
zernio ads:list --platform facebook --limit 5 --pretty
```

Inspect each ad's ID, platform, status, and metrics. Results can include ads created outside Zernio; do not assume every returned ad belongs to your automation.

## Commands

Set `ACCOUNT_ID` from `accounts:list`. Read ad accounts before setting `AD_ACCOUNT_ID`; it is not the connected-account ID.

| Task | Command | Required inputs and outcome |
|---|---|---|
| Discover ad accounts | `zernio ads:list-accounts --accountId "$ACCOUNT_ID"` | Connected-account ID; available ad accounts |
| Read ads | `zernio ads:list --accountId "$ACCOUNT_ID" --adAccountId "$AD_ACCOUNT_ID"` | Optional scope filters; ads and metrics |
| Read campaigns | `zernio adcampaigns:list-ad-campaigns --adAccountId "$AD_ACCOUNT_ID"` | Optional ad-account filter; campaigns |
| Read audiences | `zernio adaudiences:list-ad-audiences --accountId "$ACCOUNT_ID" --adAccountId "$AD_ACCOUNT_ID"` | Both IDs required; audiences |
| Find lead forms | `zernio ads:list-lead-forms --accountId "$ACCOUNT_ID"` | Connected-account ID; forms |
| Read a form's leads | `zernio ads:list-form-leads "$FORM_ID" --accountId "$ACCOUNT_ID"` | Form and connected-account IDs; leads |
| Read conversion destinations | `zernio ads:list-conversion-destinations "$ACCOUNT_ID"` | Positional connected-account ID; destinations |
| Read tag event statistics | `zernio trackingtags:stats "$ACCOUNT_ID" "$TAG_ID"` | Connected-account and tag IDs; event statistics |

Command names are exact: use `adcampaigns:list-ad-campaigns`, not `adcampaigns:list`. Check `--help` for the installed version's flags.

## Verify scope before writes

Use the appropriate [ads platform guide](/platforms/meta-ads) to choose the operation and understand budget, targeting, and platform requirements. Then inspect the actual CLI command's help.

Record the target connected account, ad account, campaign or ad ID, and intended change. After an approved write, list the resource again and compare its status and configuration.

Do not automatically repeat ad creation, conversion submission, or campaign changes after an ambiguous failure. Reconcile remote state first. A duplicate operation can create spend or duplicate events.

## How it behaves

- `ads:list` accepts `--source`, `--status`, `--platform`, `--accountId`, `--adAccountId`, `--campaignId`, `--fromDate`, and `--toDate`, among other filters.
- Campaign, audience, conversion, and tracking-tag commands do not share identical required inputs. Positional IDs and flags are not interchangeable.
- Ads and campaign lists support `--page` and `--limit`. Follow returned pagination rather than treating one page as the full inventory.
- Inspect returned synchronization or backfill indicators before treating metrics as final. CLI output contains the response body, not an HTTP-status envelope.
- Plan access and platform permissions can reject a request. Read the CLI error message and status before changing credentials.

## Related

- [List ads](/ad-campaigns/list-ads)
- [Create a campaign](/ad-campaigns/create-ad-campaign)
- [Ad audiences](/ad-audiences/create-ad-audience)
- [Tracking tags](/tracking-tags/create-tracking-tag)
- [CLI for agents](/cli/agents)