# List agents for an analysis group

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

Group: Analysis groups. Page: https://www.nabrah.ai/en/docs/api-reference/analysis-groups/list-agents-for-an-analysis-group

Lists all agents currently linked to the analysis group identified by `analysis_group_id`. This shows the many-to-many relationship from the analysis group's side. Each returned agent includes the `link_id` for its association with this group — needed to unlink via DELETE /api/ext/analysis/link/{link_id}.

## Where analysis_group_id comes from

- **Discovering the ID**: List groups with GET /api/ext/analysis, or use the `id` returned by POST /api/ext/analysis.

## Response shape

Returns a JSON array of brief agent objects.

- **Each item carries a link_id**: Alongside agent metadata, each item includes the `link_id` for this agent↔group link. Save it to unlink later. Fields: `agent_id`, `name`, `created_at`, `last_update`, `created_by_email`, `link_id`, `enable_ticket_creation`.

## Authorization

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

## Path parameters

- `analysis_group_id` (string, required): UUID of the analysis group whose linked agents you want to list. Get this from GET /api/ext/analysis or from the create response (POST /api/ext/analysis).

## Response

### 200 Successful Response

Content type: `application/json`

```json
[
  {
    "agent_id": "00000000-0000-4000-8000-000000000000",
    "name": "string",
    "created_at": "2026-01-15T12:00:00.000Z",
    "last_update": "2026-01-15T12:00:00.000Z",
    "created_by_email": "string",
    "link_id": "00000000-0000-4000-8000-000000000000",
    "enable_ticket_creation": false
  }
]
```

### 422 Validation Error

Content type: `application/json`

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

## Request examples

### cURL

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

### Python

```python
import requests

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

response = requests.get(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>/agents", {
  method: "GET",
  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("GET", "https://api.nabrah.ai/api/ext/analysis/<analysis_group_id>/agents", 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))
}
```
