PUT /api/v2/storefront/inventory-sources/{sourceId}/ad-server
Sets the ad-server configuration on an ad-server-backed source. The body fully replaces the config (PUT semantics). PATCH /api/v2/storefront/inventory-sources/{sourceId}/ad-server is accepted as an alias with the same body and response, for clients migrating from the legacy /esa/ad-server route.
Request
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
sourceId | string (path) | Yes | Storefront-scoped inventory source ID |
type | enum | Yes | Discriminator: google_ad_manager, freewheel, or springserve |
google_ad_manager
| Field | Type | Required | Notes |
|---|---|---|---|
networkCode | string | Yes | Numeric GAM network code (1–32 digits). Scope3 manages the service-account credentials |
freewheel
| Field | Type | Required | Notes |
|---|---|---|---|
username | string | Conditional | Required for password grant; omit when using apiToken |
password | string | Conditional | Required for password grant. Write-only — never returned or persisted by Scope3 |
apiToken | string | Conditional | Pre-minted token; used only when no username/password. Testing only |
environment | enum | No | production (default) or staging |
defaultAdvertiserId | string | No | Default FreeWheel advertiser id (max 64) |
springserve
| Field | Type | Required | Notes |
|---|---|---|---|
email | string | Conditional | Required for password grant; omit when using apiToken |
password | string | Conditional | Required for password grant. Write-only — never returned or persisted by Scope3 |
apiToken | string | Conditional | Pre-minted token; used only when no email/password. Testing only |
environment | enum | No | production (only supported value) |
defaultDemandPartnerId | integer | No | Default SpringServe demand partner id |
Response
200 OK with the updated EsaConnection (see Get ad-server connection for the full shape):
serviceAccountEmail is the address the publisher must grant access to in their GAM admin console before provisioning succeeds.
Errors
400 VALIDATION_ERROR— unknowntype, missing credentials for the chosen adapter, or malformednetworkCode.401 UNAUTHORIZED— missing or invalid API key.404 NOT_FOUND— no ad-server-backed source with thissourceId.
Related
Inventory source tasks
All operations
Rotate credentials
In-place credential rotation
Test connection
Probe upstream reachability
Get ad-server connection
Connection state