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

# Update inventory source

> Update an AGENT inventory source, rotate its auth, or transition its status

`PUT /api/v2/storefront/inventory-sources/{sourceId}`

Updates an `AGENT` inventory source. Updates are partial — send any subset of fields. Status transitions manage the linked agent lifecycle. `MANAGED_SALES_AGENT`, `LINKED_STOREFRONT`, and `MODULAR_SOURCE` lifecycles use their dedicated flows instead.

## Request

<CodeGroup>
  ```bash curl theme={null}
  curl -X PUT https://api.interchange.io/api/v2/storefront/inventory-sources/retail-network-agent \
    -H "Authorization: Bearer $SCOPE3_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Retail Network Agent (Primary)",
      "status": "ACTIVE",
      "description": "On-site display and CTV inventory"
    }'
  ```

  ```json Rotate auth theme={null}
  {
    "authenticationType": "API_KEY",
    "auth": { "type": "bearer", "token": "<NEW_SOURCE_API_KEY>" }
  }
  ```
</CodeGroup>

## Parameters

| Field                | Type          | Required | Notes                                                                                                                             |
| -------------------- | ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `sourceId`           | string (path) | Yes      | Storefront-scoped inventory source ID                                                                                             |
| `name`               | string        | No       | Display name (1–255 chars)                                                                                                        |
| `executionType`      | enum          | No       | `AGENT` only                                                                                                                      |
| `status`             | enum          | No       | `PENDING`, `ACTIVE`, or `DISABLED`                                                                                                |
| `description`        | string        | No       | Agent description (max 2000)                                                                                                      |
| `endpointUrl`        | string (uri)  | No       | Agent endpoint URL (max 2048)                                                                                                     |
| `protocol`           | enum          | No       | `MCP` or `A2A`                                                                                                                    |
| `authenticationType` | enum          | No       | `API_KEY`, `JWT`, `BASIC_AUTH`, `NO_AUTH`, or `OAUTH`                                                                             |
| `auth`               | object        | No       | Updating `auth` rotates the stored credential. **Omit to keep existing credentials.** Same API-key / Basic / JWT shapes as create |

<Note>
  Allowed status transitions: `PENDING → ACTIVE`, `PENDING → DISABLED`, and `ACTIVE ↔ DISABLED`. A source cannot transition back to `PENDING`. Setting `status: ACTIVE` requires the backing agent to be authenticated. AAO compliance is surfaced as an advisory signal, not an activation blocker.
</Note>

## Response

`200 OK` with the updated `InventorySourceResponse`:

```json theme={null}
{
  "id": "900123456789",
  "sourceId": "retail-network-agent",
  "name": "Retail Network Agent (Primary)",
  "executionType": "AGENT",
  "status": "ACTIVE",
  "agentId": "agent_01HX...",
  "type": "SALES",
  "endpointUrl": "https://agent.retail-network.example.com/mcp",
  "protocol": "MCP",
  "authenticationType": "API_KEY",
  "authConfigured": true,
  "isAdapterSource": false,
  "createdAt": "2026-04-25T12:05:00Z",
  "updatedAt": "2026-05-02T09:14:00Z"
}
```

## Errors

* `400 VALIDATION_ERROR` — invalid status transition, malformed `auth`, or no fields supplied.
* `401 UNAUTHORIZED` — missing or invalid API key.
* `404 NOT_FOUND` — no source with this `sourceId` on your storefront.

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="Inventory sources overview" href="/v2/storefront/inventory-sources/overview" icon="plug">
    Concepts and lifecycle
  </Card>

  <Card title="Get inventory source" href="/v2/storefront/inventory-sources/tasks/get-inventory-source" icon="magnifying-glass">
    Read one source by ID
  </Card>

  <Card title="Delete inventory source" href="/v2/storefront/inventory-sources/tasks/delete-inventory-source" icon="trash">
    Remove a source
  </Card>
</CardGroup>
