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

# Deactivate ad-server source

> Soft-delete an ad-server-backed inventory source

`POST /api/v2/storefront/inventory-sources/{sourceId}/deactivate`

Soft-deletes the ad-server source. The connection row stays in place so the storefront can re-provision later with [Reactivate](/v2/storefront/inventory-sources/tasks/reactivate).

## Request

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.interchange.io/api/v2/storefront/inventory-sources/retail-gam/deactivate \
    -H "Authorization: Bearer $SCOPE3_API_KEY"
  ```
</CodeGroup>

## Parameters

| Field      | Type          | Required | Notes                                 |
| ---------- | ------------- | -------- | ------------------------------------- |
| `sourceId` | string (path) | Yes      | Storefront-scoped inventory source ID |

## Response

`200 OK` with the `EsaConnection`, now deactivated (`deactivatedAt` is set):

```json theme={null}
{
  "id": "550199",
  "customerId": 4210,
  "tenantId": "tnt_retail_gam",
  "mcpUrl": "/mcp/",
  "a2aUrl": "/a2a",
  "adServer": { "type": "google_ad_manager", "networkCode": "12345678" },
  "serviceAccountEmail": "retail-gam-4210@scope3-esa.iam.gserviceaccount.com",
  "lastError": null,
  "lastErrorCode": null,
  "lastTestedAt": "2026-05-01T09:00:00Z",
  "provisionedAt": "2026-04-25T12:10:00Z",
  "deactivatedAt": "2026-05-02T10:00:00Z",
  "createdAt": "2026-04-25T12:05:00Z",
  "updatedAt": "2026-05-02T10:00:00Z",
  "inventorySync": null
}
```

`deactivatedAt` is set, which disables the source. The row is preserved for re-provisioning.

## Errors

* `401 UNAUTHORIZED` — missing or invalid API key.
* `404 NOT_FOUND` — no ad-server-backed source with this `sourceId`.

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

## Related

<CardGroup cols={2}>
  <Card title="Inventory source tasks" href="/v2/storefront/inventory-sources/tasks" icon="list-check">
    All operations
  </Card>

  <Card title="Reactivate" href="/v2/storefront/inventory-sources/tasks/reactivate" icon="rotate-right">
    Re-enable this source
  </Card>

  <Card title="Get ad-server connection" href="/v2/storefront/inventory-sources/tasks/get-ad-server-connection" icon="server">
    Connection state
  </Card>

  <Card title="Inventory sources overview" href="/v2/storefront/inventory-sources/overview" icon="plug">
    Concepts and lifecycle
  </Card>
</CardGroup>
