Use the AdMassy CLI
Run launches, uploads, status changes and reports from a terminal or script with the private-ads CLI, using the same reviewed jobs as the app.
Last updated
On this page
The CLI is a thin client for the REST API. It is useful in scripts, CI jobs and for people who prefer a terminal.
Note: The CLI lives in AdMassy's private repository (
cli/ads.mjs, commandprivate-ads). It needs Node 24. Ask us at info@admassy.com if you need access.
Set up
- Install dependencies in the repository with
npm ci. - Create an API token in Connect › MCP & CLI (see REST API).
- Set the environment variables below. There is no
logincommand. - Optionally save defaults with
node cli/ads.mjs config --url https://app.admassy.com --account act_123. They are stored in~/.private-meta/config.json.
export ADS_API_URL=https://app.admassy.com
export ADS_TOKEN=ads_…
# optional: export ADS_CONNECTION_ID=…
Check the connection
node cli/ads.mjs whoami
node cli/ads.mjs accounts
Common commands
| Task | Command |
|---|---|
| List objects | campaigns, adsets, ads |
| Upload media | upload |
| Import a sheet | import, csv:import |
| Create a build | builds:create |
| Review a launch | preview |
| Launch a review | launch --preview-id … --idempotency-key … |
| Follow a job | jobs <ID> --follow |
| Retry, cancel, reconcile | jobs:retry, jobs:cancel, jobs:reconcile |
| Duplicate | duplicate:preview, then duplicate |
| Pause / resume | status:preview, then status:apply |
| Edit a live ad | ad:edit-preview, then ad:edit-apply |
| Delivery check | delivery |
| Reporting | performance:* |
A scripted launch
node cli/ads.mjs preview <buildId> # prints a previewId
node cli/ads.mjs launch --preview-id <previewId> --idempotency-key nightly-2026-10-09
node cli/ads.mjs jobs <jobId> --follow
Every write is a preview followed by an apply, exactly like the app. See How reviewed writes work.
Exit codes
0success,1an error (bad input, auth, network),2the job failed or only partly succeeded.
Use them in CI to stop a pipeline when a launch does not fully succeed.
Related
Was this article helpful?