> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erdo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Which account a connection uses

> Connecting an advertising platform grants access to every account your login can see, so each connection records which one it operates — chosen when you connect, and changeable afterwards from the app, the API, or the CLI.

# Which account a connection uses

When you connect Google Ads, Meta Ads, TikTok Ads, Reddit Ads, or Google Analytics, you authorize
Erdo against a *login*, not against an account. That login usually reaches several accounts: a
marketing agency's Google account can see every client it manages, and a Meta login can see every ad
account under every Business Manager it belongs to. The grant covers all of them.

That leaves one question the authorization itself cannot answer — **which of those accounts is this
connection for?** It is a property of the connection rather than of any one dashboard or dataset,
because it decides the account for everything the connection does: every dataset built on it, every
sync it runs, and every action an agent takes through it.

So Erdo asks as soon as you connect, and records the answer on the connection.

## Choosing when you connect

After you authorize the provider, Erdo lists the accounts that connection can reach and asks you to
pick one. For Google Ads that includes accounts reachable only through a manager (MCC) account —
Erdo asks each account it can see directly whether it manages others, so client accounts appear even
though the provider does not list them directly.

Pick the account and the connection is ready. Everything Erdo does through it from then on runs
against that account.

**One account per connection.** To work with a second account, connect the integration again and
choose that account. Two connections to the same provider are normal and expected — an agency
typically has one per client.

**Choosing is optional.** Connecting often comes *before* the account exists: you authorize Google
Ads or Meta so that Erdo can go and create an ad account for you, and until it has, there is nothing
to choose between. Skip the question and the connection is made anyway. Erdo records the account it
creates against the connection, and you can set or change it yourself at any point.

A connection with no account recorded cannot read or write anything at the provider yet, so Erdo
says so where it matters rather than blocking the connection: building a dataset on one asks for the
account before it will read.

## Changing it later

The choice is not permanent, and skipping it is not final. In the app, find the connection under
your connectors and use **Account** on it. Over the API or CLI, read the accounts a connection can
reach and set the one it should use.

<CodeGroup>
  ```bash CLI theme={null}
  # Which connections do you have?
  erdo integrations list

  # Which accounts can this one reach, and which is it using? (* marks the current one)
  erdo integrations account show 53bea27a-891a-42ef-88b1-e70fc9fdf7dd

  # Use a different one
  erdo integrations account set 53bea27a-891a-42ef-88b1-e70fc9fdf7dd 8834039525
  ```

  ```bash REST theme={null}
  curl -H "Authorization: Bearer $ERDO_API_KEY" \
    https://api.erdo.ai/v1/integrations/$INTEGRATION_ID/connection-scope

  curl -X POST -H "Authorization: Bearer $ERDO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"account_id": "8834039525"}' \
    https://api.erdo.ai/v1/integrations/$INTEGRATION_ID/connection-scope
  ```
</CodeGroup>

Over MCP the same two operations are `erdo_get_connection_scope` and `erdo_set_connection_scope`.

## What comes back

```json theme={null}
{
  "integration_id": "53bea27a-891a-42ef-88b1-e70fc9fdf7dd",
  "has_connection_scope": true,
  "description": "Choose the Google Ads account this connection manages.",
  "options": [
    { "id": "8834039525", "name": "2200 Brickell", "type": "account" },
    { "id": "5302012239", "name": "Erdo AI", "type": "account" }
  ],
  "selected": [{ "id": "8834039525", "name": "2200 Brickell", "type": "account" }],
  "required": true
}
```

| Field                  | Meaning                                                                                                                                                                                                                             |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `has_connection_scope` | Whether this integration chooses an account per connection at all. **False** for a database connection, which names its database in its credentials — there is nothing to choose.                                                   |
| `description`          | What the choice means for this provider, for showing to a person.                                                                                                                                                                   |
| `options`              | The accounts this connection can reach. Address them by `id`; `name` is for showing a person which is which.                                                                                                                        |
| `selected`             | The account the connection currently operates. Empty when none has been chosen.                                                                                                                                                     |
| `required`             | Whether the connection can resolve an account at all before one is chosen. When `true`, datasets and actions on this connection fail until it is set — a consequence to plan around, not a gate: the connection is made either way. |

Address an account by the `id` the options list gives you, exactly as it appears. Account ids are
not numeric everywhere — a Meta ad account is `act_1234567890` and a Reddit one is `a2_bzv32cgqp` —
and a Google customer id is accepted in either the `530-201-2239` form its UI shows or the
`5302012239` form its API wants.

Some providers reach an account through an owner — a Reddit ad account belongs to a business, a GA4
property belongs to an account. Those appear as `parent` on the option, and setting the account
records the whole path, so you never have to name the owner separately.

## Filtering within the account

Choosing the account is not the same as narrowing what a dashboard reads. Once a connection knows its
account, a dataset built on it can still filter to specific campaigns, lists, or flows — that filter
belongs to the dataset, because two dashboards on one connection routinely want different slices of
the same account.

You will see both: the account on the connection, and the campaign filter on the dataset.

## If an account is missing

The list holds exactly what the provider says that login can reach. If it is empty because you do
not have an account yet, that is the expected state — leave it, and set the account once it exists.
Otherwise a missing account is almost always a permissions question at the provider rather than in
Erdo:

* **The login lacks access.** Grant it access in the provider's own UI, then reconnect.
* **The account sits under a manager the login cannot see.** Google Ads client accounts are found by
  asking each directly-accessible account what it manages, so a client account is only reachable if
  the login can see its manager.
* **The connection needs reauthorizing.** A connection whose grant expired cannot list anything.
  Reconnect it and the accounts return.
