# Delete rows by id, or one page of the rows a selector matches

> Source: https://elaichi.ai/docs/api-reference/collections/collection/deletecollectionrows/

`POST /collection/{id}/rows/delete`

Resource: **Collection** · API: **Collections**

## Path parameters

- **`id`** _(string, required)_
  Resource id

## Request body

- **`row_ids`** _(array<string>)_
- **`filter`** _(unknown)_
- **`q`** _(string)_
- **`all`** _(boolean)_
  Allowed: `true`
- **`limit`** _(integer)_
- **`cursor`** _(string)_

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/collection/<id>/rows/delete' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"row_ids":[],"q":"your_q","all":true,"limit":0,"cursor":"your_cursor"}'
```

### JavaScript

```javascript
const body = {
  "row_ids": [],
  "q": "your_q",
  "all": true,
  "limit": 0,
  "cursor": "your_cursor"
};

const response = await fetch('https://api.elaichi.ai/collection/<id>/rows/delete', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/collection/<id>/rows/delete"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "row_ids": [],
    "q": "your_q",
    "all": True,
    "limit": 0,
    "cursor": "your_cursor"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```
