POST /api/query-ads — see the
API reference.
Unlike upstack query (nested result blocks) or
upstack query-channel-details (entity
listing with basic details), query-ads always returns a flat
{ rows, pagination } shape, which makes it the simplest command to script
or consume programmatically.
When --measures is omitted, the command is a listing-only call: every
ad on the pixel comes back with its metadata and no metric series. Adding
--measures with a date range attaches a daily metric series per ad.
Usage
Required flags
None. A bareupstack query-ads lists ads with pagination.
Optional flags
From-file schema
--from-file takes a JSON file of parameter-style keys — the same keys as the
flags, not the API request body. CLI flags override file values.
measures (array of { "measure": "<id>" } or a comma-separated
string), dateStart, dateEnd, compareDateStart, compareDateEnd, timezone,
currency, filter, limit, offset, sortBy, sortDirection, output.
Do not use the API body shape (dateRange, compareDateRange) — those keys are
ignored and the request fails validation with "dateRange" is required.
Response shape
rows with basicDetails and an empty data.
Metric calls fill data.primary (one entry per date bucket that has data —
ads with no data in the period return an empty data.primary array, not
zero-filled buckets) and, when a compare range is given, data.compare.
pagination.hasMore tells you whether to page with --offset.
Examples
See also
upstack filters— discover valid filter fields, operators, and applicable contexts (query_adsmarks the fields valid here).upstack measures— list measure ids available across all query endpoints.upstack query-channel-details— account / campaign / adset / ad listing with basic entity details.- AI agent workflow — using the CLI from an AI agent.