$npx -y skills add rorkai/app-store-connect-cli-skills --skill asc-apple-adsUse when managing Apple Ads with asc, including auth, org lookup, campaigns, ad groups, ads, keywords, reports, raw API calls, and safe live testing.
| 1 | # asc Apple Ads |
| 2 | |
| 3 | Use this skill when a task involves Apple Ads or `asc ads`. |
| 4 | |
| 5 | ## Ground Rules |
| 6 | - Run `asc ads --help` or the specific subgroup help before scripting a command. |
| 7 | - Apple Ads auth is separate from App Store Connect auth. `asc auth login` does not configure `asc ads`. |
| 8 | - Use JSON output for automation: `--output json`. |
| 9 | - Most commands need an org ID. Prefer `--org` for one-off commands and `ASC_ADS_ORG_ID` for a scoped session. |
| 10 | - Never guess payload fields. Use Apple Ads request JSON in a file and pass it with `--file`. |
| 11 | - Do not mutate a live account until the user has named the org and approved the resource type. Prefer read-only checks first. |
| 12 | |
| 13 | ## Auth |
| 14 | |
| 15 | Stored profile: |
| 16 | |
| 17 | ```bash |
| 18 | asc ads auth login \ |
| 19 | --name "Marketing" \ |
| 20 | --client-id "$ASC_ADS_CLIENT_ID" \ |
| 21 | --team-id "$ASC_ADS_TEAM_ID" \ |
| 22 | --key-id "$ASC_ADS_KEY_ID" \ |
| 23 | --private-key "$ASC_ADS_PRIVATE_KEY_PATH" \ |
| 24 | --org "$ASC_ADS_ORG_ID" \ |
| 25 | --network |
| 26 | ``` |
| 27 | |
| 28 | Environment auth: |
| 29 | |
| 30 | ```bash |
| 31 | export ASC_ADS_CLIENT_ID="SEARCHADS_CLIENT_ID" |
| 32 | export ASC_ADS_TEAM_ID="SEARCHADS_TEAM_ID" |
| 33 | export ASC_ADS_KEY_ID="KEY_ID" |
| 34 | export ASC_ADS_PRIVATE_KEY_PATH="$HOME/.asc/apple-ads-private-key.pem" |
| 35 | export ASC_ADS_ORG_ID="123456" |
| 36 | ``` |
| 37 | |
| 38 | Short-lived token auth: |
| 39 | |
| 40 | ```bash |
| 41 | export ASC_ADS_ACCESS_TOKEN="ACCESS_TOKEN" |
| 42 | export ASC_ADS_ORG_ID="123456" |
| 43 | ``` |
| 44 | |
| 45 | Useful checks: |
| 46 | |
| 47 | ```bash |
| 48 | asc ads auth status --validate --output json |
| 49 | asc ads auth doctor --output json |
| 50 | asc ads me view --output json |
| 51 | asc ads acls --output json |
| 52 | ``` |
| 53 | |
| 54 | ## Org Resolution |
| 55 | |
| 56 | When the org ID is unknown: |
| 57 | |
| 58 | ```bash |
| 59 | asc ads acls --output json |
| 60 | ``` |
| 61 | |
| 62 | Use the returned org ID: |
| 63 | |
| 64 | ```bash |
| 65 | asc ads campaigns --org "123456" --limit 10 --output json |
| 66 | ``` |
| 67 | |
| 68 | Org precedence is `--org`, `ASC_ADS_ORG_ID`, stored profile `org_id`, then config `ads.org_id`. |
| 69 | |
| 70 | ## Read Workflows |
| 71 | |
| 72 | Campaigns and ad groups: |
| 73 | |
| 74 | ```bash |
| 75 | asc ads campaigns --org "123456" --limit 100 --output json |
| 76 | asc ads campaigns --org "123456" --paginate --output json |
| 77 | asc ads campaigns view --org "123456" --campaign 987654321 --output json |
| 78 | asc ads ad-groups list --org "123456" --campaign 987654321 --output json |
| 79 | ``` |
| 80 | |
| 81 | Discovery: |
| 82 | |
| 83 | ```bash |
| 84 | asc ads apps search --org "123456" --query "My App" --limit 10 --output json |
| 85 | asc ads product-pages list --org "123456" --adam-id 1234567890 --states VISIBLE --output json |
| 86 | asc ads creatives list --org "123456" --limit 100 --output json |
| 87 | asc ads geo search --org "123456" --query "San Francisco" --country-code US --limit 10 --output json |
| 88 | ``` |
| 89 | |
| 90 | Reports: |
| 91 | |
| 92 | ```bash |
| 93 | asc ads reports campaigns --org "123456" --file reporting-request.json --output json |
| 94 | asc ads reports keywords --org "123456" --campaign 987654321 --file reporting-request.json --output json |
| 95 | ``` |
| 96 | |
| 97 | Reporting and find endpoints keep pagination in the JSON body. |
| 98 | |
| 99 | ## Mutating Workflows |
| 100 | |
| 101 | Create and update commands take Apple Ads JSON files: |
| 102 | |
| 103 | ```bash |
| 104 | asc ads campaigns create --org "123456" --file campaign.json --output json |
| 105 | asc ads campaigns update --org "123456" --campaign 987654321 --file campaign-update.json --output json |
| 106 | asc ads ad-groups create --org "123456" --campaign 987654321 --file ad-group.json --output json |
| 107 | ``` |
| 108 | |
| 109 | Bulk endpoints often require arrays: |
| 110 | |
| 111 | ```bash |
| 112 | asc ads targeting-keywords create-bulk \ |
| 113 | --org "123456" \ |
| 114 | --campaign 987654321 \ |
| 115 | --ad-group 123456789 \ |
| 116 | --file keywords.json \ |
| 117 | --output json |
| 118 | ``` |
| 119 | |
| 120 | Delete commands require `--confirm`: |
| 121 | |
| 122 | ```bash |
| 123 | asc ads targeting-keywords delete-bulk \ |
| 124 | --org "123456" \ |
| 125 | --campaign 987654321 \ |
| 126 | --ad-group 123456789 \ |
| 127 | --file keyword-ids.json \ |
| 128 | --confirm \ |
| 129 | --output json |
| 130 | |
| 131 | asc ads campaigns delete --org "123456" --campaign 987654321 --confirm |
| 132 | ``` |
| 133 | |
| 134 | For live tests, create paused resources with names such as `ASC CLI Live Test <timestamp>`. Clean up only the parent campaign or ad group created for that test. Apple may reject direct deletion for default product page creative ads, but deleting the test parent campaign or ad group can clean up the test resource. |
| 135 | |
| 136 | ## Raw API |
| 137 | |
| 138 | Use raw requests when Apple adds a field before the first-class command surface changes: |
| 139 | |
| 140 | ```bash |
| 141 | asc ads api request \ |
| 142 | --method POST \ |
| 143 | --path v5/campaigns/find \ |
| 144 | --org "123456" \ |
| 145 | --file selector.json \ |
| 146 | --output json |
| 147 | ``` |
| 148 | |
| 149 | Raw requests accept only Apple Ads v5 paths or `https://api.searchads.apple.com/api/v5/...` URLs. `DELETE` still requires `--confirm`. |
| 150 | |
| 151 | ## Live Test Checklist |
| 152 | |
| 153 | - Start with `asc ads me view --output json` and `asc ads acls --output json`. |
| 154 | - Print the target org ID before mutations. |
| 155 | - Create paused or future-dated resources. |
| 156 | - Use a unique test name. |
| 157 | - Save created IDs from JSON output. |
| 158 | - Delete only the test parent campaign or ad group created during the run. |
| 159 | - Run a final campaigns find/list query to confirm cleanup. |