# Delete analysis group

> DELETE https://api.nabrah.ai/api/ext/analysis/{analysis_group_id}

Group: Analysis groups. Page: https://www.nabrah.ai/en/docs/api-reference/analysis-groups/delete-analysis-group

Permanently deletes the analysis group identified by `analysis_group_id` along with all its data collections and any links to agents. This operation is irreversible. Fetch the group first (GET /api/ext/analysis/{analysis_group_id}) if you need to preserve its definition.

## Where analysis_group_id comes from

- **Discovering the ID**: List groups with GET /api/ext/analysis and copy the `id`, or use the `id` returned by POST /api/ext/analysis.
- **Cascading effect**: Deleting a group also removes its agent links, so agents previously linked to it will no longer run its collections.

## Authorization

- `X-API-Key` (string, header, required): your workspace API key.

## Path parameters

- `analysis_group_id` (string, required): UUID of the analysis group to delete. Get this from GET /api/ext/analysis or from the create response (POST /api/ext/analysis).

## Response

### 200 Successful Response

Content type: `application/json`

### 422 Validation Error

Content type: `application/json`

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

## Request examples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.nabrah.ai/api/ext/analysis/<analysis_group_id>' \
  --header 'X-API-Key: <your-api-key>'
```

### Python

```python
import requests

url = "https://api.nabrah.ai/api/ext/analysis/<analysis_group_id>"
headers = {"X-API-Key": "<your-api-key>"}

response = requests.delete(url, headers=headers)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.nabrah.ai/api/ext/analysis/<analysis_group_id>", {
  method: "DELETE",
  headers: { "X-API-Key": "<your-api-key>" },
});

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

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "https://api.nabrah.ai/api/ext/analysis/<analysis_group_id>", nil)
	req.Header.Set("X-API-Key", "<your-api-key>")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```
