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

# Remove products

> Drop products from a discovery session's selection

`DELETE /api/v2/buyer/discovery/{discoveryId}/products`

Removes products from the session selection. Use `productIds` for legacy
product-wide removal, or `productRefs` when you need to remove one exact
inventory-source variant or repeat selection. Products that are not in the
selection are ignored. Returns the remaining selection and refreshed budget
context.

## Request

```bash theme={null}
curl -X DELETE https://api.apostra.com/api/v2/buyer/discovery/disc_01HZX3YQ7K9R6V3M2P1E0F8B2T/products \
  -H "Authorization: Bearer $SCOPE3_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "productIds": ["prod_acme_ctv_sports"] }'
```

## Parameters

| Field         | Type      | Required | Notes                                                                                                                  |
| ------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `discoveryId` | string    | Yes      | Path param — session to modify                                                                                         |
| `productIds`  | string\[] | No\*     | Product IDs to remove. Each ID removes every matching selection instance.                                              |
| `productRefs` | object\[] | No\*     | Exact references to remove. Include `productId` and, when returned by discovery, `inventorySourceId` or `selectionId`. |

\*Provide at least one non-empty `productIds` or `productRefs` array.

To remove only one inventory-source variant when two selected products share a
storefront and product ID, send the exact provenance returned by discovery:

```json theme={null}
{
  "productRefs": [
    {
      "productId": "sf1:42:d2g6c2hhcmVkLXByb2R1Y3Q",
      "inventorySourceId": "200"
    }
  ]
}
```

## Response

```json theme={null}
{
  "discoveryId": "disc_01HZX3YQ7K9R6V3M2P1E0F8B2T",
  "products": [],
  "totalProducts": 0,
  "budgetContext": {
    "sessionBudget": 250000,
    "allocatedBudget": 0,
    "remainingBudget": 250000
  }
}
```

Returns the full remaining selection. Freed budget is reflected in `budgetContext.remainingBudget`.

## Errors

* `400 VALIDATION_ERROR` — neither removal array contains a target.
* `404 NOT_FOUND` — `discoveryId` does not exist or is not visible to the authenticated account.

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

## Related

<CardGroup cols={2}>
  <Card title="Discovery overview" href="/v2/guides/discovery" icon="rocket">
    Selection model and budget allocation
  </Card>

  <Card title="Get products" href="/v2/buyer/discovery/tasks/get-products" icon="list">
    List the current selection
  </Card>

  <Card title="Add products" href="/v2/buyer/discovery/tasks/add-products" icon="plus">
    Add products to the selection
  </Card>
</CardGroup>
