Skip to content

List available and selected ad accounts

PubNio API ads.listAccounts: list available and selected ad accounts. Request fields, examples in five clients, errors, and idempotency.

List available and selected ad accounts with GET /api/v1/ads/accounts. Requires an API key with the read scope or a signed-in workspace member.

Request

Returns currency, time zone, account status, business or manager ID, readiness, ads capabilities, and policy state from stored grants. Use state=available or state=selected to narrow the list. No provider call happens during the request.

Parameter In Type Required
workspaceId query UUID Yes
state query "available", "selected" No
cursor query string No
limit query string No

Response

  • HTTP 200: AdAccountList with data, hasMore, nextCursor.

The OpenAPI document has each field’s type.

Examples

const accounts = await workspace.ads.accounts({ state: "selected" });
accounts = workspace.ads.list_accounts()
curl "https://pubnio.com/api/v1/ads/accounts?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
pnio ads list-accounts --state selected
async () => {
  const response = await codemode.request({
    method: "GET",
    path: "/api/v1/ads/accounts",
    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