Select a discovered ad account with POST /api/v1/ads/accounts/{accountId}/select. Requires a signed-in workspace owner, in the web app or the CLI; API keys are not accepted and MCP cannot call it.
Request
Selection starts campaign and insight sync. Reconnect preserves this PubNio account ID.
| Parameter | In | Type | Required |
|---|---|---|---|
accountId |
path | UUID | Yes |
workspaceId |
query | UUID | Yes |
Response
- HTTP 200:
AdAccountSelectionwithaccountId,selected,campaignSyncQueued,insightSyncQueued.
The OpenAPI document has each field’s type.
Examples
const selection = await workspace.ads.select(accountId);Create this client with a signed-in person’s accessToken, not an apiKey.
The Python SDK authenticates with a workspace API key, which this operation does not accept, so it has no method for it.
curl -X POST "https://pubnio.com/api/v1/ads/accounts/$ACCOUNT_ID/select?workspaceId=$WORKSPACE_ID" \
-H "Authorization: Bearer $PUBNIO_TOKEN"pnio ads select-account "$ACCOUNT_ID"async () => {
const accountId = "<accountId>";
const response = await codemode.request({
method: "POST",
path: `/api/v1/ads/accounts/${accountId}/select`,
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
No key, so a retried POST is not deduplicated. Read the current state before you retry.
Limits
- API keys and MCP cannot call it. A signed-in person runs it from the CLI after
pnio auth loginor in the web app.