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

# When Apostra can't read a connection's ad accounts

> After you authorize an ad platform, Apostra reads the ad accounts that sign-in can reach. If that fails, the connection says why and who can fix it.

When you authorize an ad platform such as Meta or TikTok, Apostra reads the ad
accounts that sign-in can reach. Those accounts are what you map your
advertisers to, so a connection is not ready to buy through until the read
works.

If the read fails, the connection shows `error`, and it now also says why and who
can fix it. You or your agent no longer have to guess whether to reconnect.

## Where to read it

Read `accountDiscovery` on a connection with `get` or `search` using
`kind: "connection"` (see the [quickstart](https://docs.apostra.com/v3/quickstart.md) for connecting an agent). A seller read carries the same fact for its connection at
`connectionState.accountDiscovery`. The Connections page uses it to decide
whether to offer Reconnect.

```json theme={null}
{
  "accountDiscovery": {
    "state": "failed",
    "reason": "permission_denied",
    "resolvedBy": "buyer",
    "failedAt": "2026-10-26T10:00:00.000Z"
  }
}
```

`accountDiscovery` describes the connection's latest read of its ad accounts, so
a later successful read replaces an earlier failure. It is `null` until the
first read, and also while the connection's sign-in has expired or been revoked,
because that is the problem to fix first. After a successful read, `state` is `succeeded` and `reason`,
`resolvedBy`, and `failedAt` are `null`.

## Who can fix it

`resolvedBy` names who can fix a failed read. Apostra decides it from the
reason. Show it as it is, and do not work it out again on your side.

| `resolvedBy` | What it means | What to do |
| - | - | - |
| `buyer` | The platform refused the sign-in, or the signed-in user can't see the ad accounts | Connect again, or connect with a user who has access to the ad accounts |
| `apostra` | A setup or internal problem on Apostra's side | Nothing. Apostra is fixing it, and reconnecting won't help |
| `provider` | The platform is rate limiting, unavailable, or returned something Apostra can't use | Try again later. Reconnecting won't help |

## The reasons

| `reason` | `resolvedBy` |
| - | - |
| `authentication_required` | `buyer` |
| `permission_denied` | `buyer` |
| `missing_configuration` | `apostra` |
| `internal_error` | `apostra` |
| `rate_limited` | `provider` |
| `provider_unavailable` | `provider` |
| `provider_rejected` | `provider` |
| `invalid_provider_response` | `provider` |

`failedAt` is when the failed read happened. It is `null` for a failure
recorded before Apostra kept the time.

## Reconnecting

Reconnect only when `resolvedBy` is `buyer`, or when the connection is in
`error` with no failed read. A connection can also be in `error` because its
sign-in expired or was revoked, and connecting again fixes that.

Reconnecting targets the connection you already have. Pass its `connectionId`
to `save_connection` so the new sign-in replaces the broken one instead of
creating a second connection. See [Connecting ad platform
accounts](https://docs.apostra.com/v2/guides/connecting-ad-platforms.md) for how to authorize each
platform.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.