
## Delete a product from a lead

`DELETE /v1/leads/:id/products/:rowId`

Deletes a single product line from a lead by row ID. A deleted line cannot be restored via the API — add a new one if needed.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Lead ID |
| `rowId` (path) | number | yes | Product row ID (from the add or list response) |

`rowId` is the product row ID, not the catalog `productId`.

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/leads/312/products/1465" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/leads/312/products/1465" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/leads/312/products/1465', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

if (res.status === 204) {
  console.log('Product removed from the lead')
}
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/leads/312/products/1465', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

if (res.status === 204) {
  console.log('Deleted')
}
```

## Response

On successful deletion, HTTP status `204 No Content` is returned with an empty body — success is checked by the status.

## Response example

```
HTTP/1.1 204 No Content
```

## Error response example

404 — lead not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Item not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 404 | `ENTITY_NOT_FOUND` | Lead or product row not found |
| 403 | `SCOPE_DENIED` | API key lacks the `crm` scope |
| 401 | `TOKEN_MISSING` | API key has no configured tokens |

Full list of common API errors — [Errors](/docs/errors).

## See also

- [Product lines](/docs/entities/leads/products-get)
- [Add a product](/docs/entities/leads/products-add)
- [Set products](/docs/entities/leads/products-set)
- [Catalog products](/docs/entities/products)
