Skip to content

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, command private-ads). It needs Node 24. Ask us at info@admassy.com if you need access.

Set up

  1. Install dependencies in the repository with npm ci.
  2. Create an API token in Connect › MCP & CLI (see REST API).
  3. Set the environment variables below. There is no login command.
  4. 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

TaskCommand
List objectscampaigns, adsets, ads
Upload mediaupload
Import a sheetimport, csv:import
Create a buildbuilds:create
Review a launchpreview
Launch a reviewlaunch --preview-id … --idempotency-key …
Follow a jobjobs <ID> --follow
Retry, cancel, reconcilejobs:retry, jobs:cancel, jobs:reconcile
Duplicateduplicate:preview, then duplicate
Pause / resumestatus:preview, then status:apply
Edit a live adad:edit-preview, then ad:edit-apply
Delivery checkdelivery
Reportingperformance:*

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

  • 0 success,
  • 1 an error (bad input, auth, network),
  • 2 the job failed or only partly succeeded.

Use them in CI to stop a pipeline when a launch does not fully succeed.

Was this article helpful?