Skip to content

List one account's campaigns newest first

PubNio API ads.listCampaigns: list one account's campaigns newest first. Request fields, examples in five clients, errors, and idempotency.

List one account’s campaigns newest first with GET /api/v1/ads/accounts/{accountId}/campaigns. Requires an API key with the read scope or a signed-in workspace member.

Request

Parameter In Type Required
accountId path UUID Yes
workspaceId query UUID Yes
provider query one of 9 strings No
status query one of 9 strings No
managed query "provider", "pubnio" No
cursor query string No
limit query string No

Response

  • HTTP 200: AdCampaignList with data, hasMore, nextCursor, freshness.

The OpenAPI document has each field’s type.

Examples

const campaigns = await workspace.ads.accountCampaigns(accountId, {
  status: "paused",
});
campaigns = workspace.ads.list_campaigns(account_id)
curl "https://pubnio.com/api/v1/ads/accounts/$ACCOUNT_ID/campaigns?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
pnio ads list-campaigns "$ACCOUNT_ID" --status paused
async () => {
  const accountId = "<accountId>";
  const response = await codemode.request({
    method: "GET",
    path: `/api/v1/ads/accounts/${accountId}/campaigns`,
    query: { workspaceId: codemode.workspaceId },
  });
  return response.data;
};

Errors

It declares no problem of its own.

It declares the problems every Ads operation and most operations declare.

Idempotency

None needed: a read is safe to retry.

Limits

  • Up to 100 items a page; pass nextCursor back as cursor. See Pagination.

Type to search…

↑↓ navigate↵ selectEsc close