> ## 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.

# Set default advertiser

> Set the catch-all advertiser for buyer routing on an ESA

`PUT /api/v2/storefront/esa/{esaId}/default-advertiser`

Sets the catch-all advertiser for an embedded sales agent. Every incoming buyer that has no matching per-buyer mapping routes to this advertiser. Setting it clears this ESA's blocker from the **Advertiser for live buys** readiness check; the check remains partial if another source still needs a default advertiser. On Google Ad Manager, it also clears the `Default GAM advertiser` setup task. Call again with a different `advertiserId` to replace it.

Available on Google Ad Manager, FreeWheel, and AdsWizz sources. The call is rejected for SpringServe, which organizes demand as demand tags and has no advertiser to route to.

Each ad server keeps its default advertiser in its own place — Google Ad Manager on the tenant, FreeWheel and AdsWizz on their adapter config — and this endpoint routes the write for you. The Google Ad Manager-only `PUT /esa/{esaId}/gam/default-advertiser` remains for existing integrations.

<Note>
  You do not have to call this endpoint. The **ad server source** page's "Set
  default advertiser" action does the same read and write for every ad server that
  has a default advertiser, so a seller can do this themselves — see
  [Setting it without the API](/v2/storefront/buyer-routing/overview#setting-it-without-the-api).
  Until that picker covered every ad server, the **Advertiser for live buys**
  readiness check asked FreeWheel and AdsWizz sellers to contact us; it now links
  them to the control.
</Note>

## Request

<CodeGroup>
  ```bash curl theme={null}
  curl -X PUT https://api.apostra.com/api/v2/storefront/esa/123/default-advertiser \
    -H "Authorization: Bearer $SCOPE3_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "advertiserId": "4567890123" }'
  ```
</CodeGroup>

## Parameters

| Field          | Type    | Required | Notes                                                                                                                                                                                                                                                                                             |
| -------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `esaId`        | integer | Yes      | Path. Embedded sales-agent connection id                                                                                                                                                                                                                                                          |
| `advertiserId` | string  | Yes      | Advertiser id, max 64 chars. GAM: from [list](/v2/storefront/buyer-routing/tasks/list-gam-advertisers) or [ensure](/v2/storefront/buyer-routing/tasks/ensure-gam-advertiser). FreeWheel and AdsWizz: from [list adapter advertisers](/v2/storefront/buyer-routing/tasks/list-adapter-advertisers) |

## Response

```json theme={null}
{
  "advertiserId": "4567890123"
}
```

`advertiserId` echoes the advertiser now serving as the catch-all for unmatched buyers.

## Errors

* `400 VALIDATION_ERROR` — several unrelated causes share this status, and the message says which:
  * **Bad input** — `advertiserId` is empty or over 64 characters, or `esaId` is not a positive integer. Correct the value and retry.
  * **The source is deactivated** — reactivate it before configuring buyer routing.
  * **The source has no tenant id** — provisioning did not finish. Complete or repair the connection rather than retrying the write.
  * **No advertiser entity to write to** — "This ad server has no advertiser to route buyers to". Permanent for SpringServe. The same message is returned when the source's ad server is not set or is unrecognized, which means the connection is not fully provisioned.
  * **The ad server rejected the advertiser id** — either it did not confirm the id you sent, or it rejected it outright. Re-read the roster with [list adapter advertisers](/v2/storefront/buyer-routing/tasks/list-adapter-advertisers) and send an id from that response.
  * **The connection is broken or under-permissioned** — invalid credentials, invalid adapter configuration, network not found, permission denied, or a key limit. Repair the connection; a different `advertiserId` will not help.
* `404 NOT_FOUND` — either `esaId` is not one of your account's sources (a wrong or stale id, or the wrong account in scope) or the upstream ad-server tenant is missing. The message distinguishes them.
* `409 CONFLICT` — a conflicting concurrent change. Re-read the current value and retry.
* `503 SERVICE_UNAVAILABLE` — the ad server is temporarily unavailable. Retry later without changing the request.

See [Errors](/v2/reference/errors) for the full error contract.

## Related

<CardGroup cols={2}>
  <Card title="Buyer routing tasks" href="/v2/storefront/buyer-routing/tasks" icon="list-check">
    All buyer-routing operations
  </Card>

  <Card title="Buyer routing overview" href="/v2/storefront/buyer-routing/overview" icon="route">
    How buyers resolve to advertisers
  </Card>

  <Card title="Ensure GAM advertiser" href="/v2/storefront/buyer-routing/tasks/ensure-gam-advertiser" icon="plus">
    Provision a catch-all advertiser
  </Card>

  <Card title="Create buyer mapping" href="/v2/storefront/buyer-routing/tasks/create-buyer-mapping" icon="link">
    Override the default for one buyer
  </Card>
</CardGroup>
